freebsd-skq/sys
dwmalone be405a4cbd falloc allocates a file structure and adds it to the file descriptor
table, acquiring the necessary locks as it works. It usually returns
two references to the new descriptor: one in the descriptor table
and one via a pointer argument.

As falloc releases the FILEDESC lock before returning, there is a
potential for a process to close the reference in the file descriptor
table before falloc's caller gets to use the file. I don't think this
can happen in practice at the moment, because Giant indirectly protects
closes.

To stop the file being completly closed in this situation, this change
makes falloc set the refcount to two when both references are returned.
This makes life easier for several of falloc's callers, because the
first thing they previously did was grab an extra reference on the
file.

Reviewed by:	iedowse
Idea run past:	jhb
2003-10-19 20:41:07 +00:00
..
alpha Add a stub cpu_idle() function for sparc64, alpha, powerpc. This is a 2003-10-19 02:36:07 +00:00
amd64 Add the cpu_idle_hook() function pointer so that other idlers can be 2003-10-18 22:25:07 +00:00
arm Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bit 2003-09-25 01:10:26 +00:00
boot Don't repeat selected defines from ns16550.h or sioreg.h. Just 2003-09-16 11:24:23 +00:00
cam Use bio_offset instead of bio_blkno 2003-10-18 17:26:13 +00:00
coda Include <sys/mutex.h>. Don't depend on namespace pollution in <sys/vnode.h>. 2003-10-05 07:44:45 +00:00
compat Implement partially /proc/<pid>/maps. 2003-10-19 14:13:51 +00:00
conf Add SBP-II target mode driver. 2003-10-18 05:41:31 +00:00
contrib use ND_IFINFO(). 2003-10-17 20:20:14 +00:00
crypto Fix alignment problem on 64 bit arch. 2003-10-14 13:37:37 +00:00
ddb Reworked rev.1.14. Use the ELF symbol type again to summarily reject 2003-09-28 06:02:33 +00:00
dev falloc allocates a file structure and adds it to the file descriptor 2003-10-19 20:41:07 +00:00
fs Remove debug printf(). 2003-10-19 14:33:00 +00:00
geom Remove KASSERT check for negative bio_offsets, add "normal" EIO 2003-10-19 19:06:54 +00:00
gnu DuH! 2003-10-18 14:10:28 +00:00
i4b Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
i386 Use npxdrop in cpu_thread_exit to save some cycles. 2003-10-19 00:57:10 +00:00
ia64 Add the cpu_idle_hook() function pointer so that other idlers can be 2003-10-18 22:25:07 +00:00
isa Eliminate use bio_blkno. 2003-10-18 17:51:26 +00:00
isofs/cd9660 DuH! 2003-10-18 14:10:28 +00:00
kern falloc allocates a file structure and adds it to the file descriptor 2003-10-19 20:41:07 +00:00
libkern - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
modules Add SBP-II target mode driver. 2003-10-18 05:41:31 +00:00
net - add dom_if{attach,detach} framework. 2003-10-17 15:46:31 +00:00
net80211 fix station mode breakage (repeat after me: "test every change, no 2003-10-17 23:59:11 +00:00
netatalk More checking of M_PREPEND() return values: pass through link-layer 2003-08-29 19:27:09 +00:00
netatm The number of prefixes can never be negative so use an u_int for this. 2003-07-29 13:46:43 +00:00
netgraph Update Bluetooth code. 2003-10-12 22:04:24 +00:00
netinet - add dom_if{attach,detach} framework. 2003-10-17 15:46:31 +00:00
netinet6 rtfree() must be called in lock context. 2003-10-18 17:46:23 +00:00
netipsec MFp4: portability work, general cleanup, locking fixes 2003-09-29 22:57:43 +00:00
netipx Fix a bunch of off-by-one errors in the range checking code. 2003-09-11 21:40:21 +00:00
netkey nuke unused ICMPV6CTL_NAMES and KEYCTL_NAMES macros. 2003-10-07 15:14:33 +00:00
netnatm Remove the last vestiges of ATM raw mode. This has not been useful for a 2003-08-06 14:34:38 +00:00
netncp The present defaults for the open and close for device drivers which 2003-09-27 12:01:01 +00:00
netsmb - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
nfs
nfsclient DuH! 2003-10-18 14:10:28 +00:00
nfsserver - Set the sopt_dir member of the sockopt structure, otherwise, this parameter 2003-10-04 17:37:51 +00:00
opencrypto falloc allocates a file structure and adds it to the file descriptor 2003-10-19 20:41:07 +00:00
pc98 MFi386: revision 1.577. 2003-10-19 11:35:44 +00:00
pccard More debug under boot verbose. 2003-08-29 23:25:00 +00:00
pci Sanitize the code relating to the /dev/ti%d entries. In particular evict 2003-10-10 20:35:28 +00:00
posix4 sched_setscheduler: Return EINVAL when a invalid policy is specified, 2003-09-13 18:46:24 +00:00
powerpc Add a stub cpu_idle() function for sparc64, alpha, powerpc. This is a 2003-10-19 02:36:07 +00:00
rpc
security Use __BEGIN_DECLS and __END_DECLS around userland function prototypes 2003-10-02 03:07:51 +00:00
sparc64 Add a stub cpu_idle() function for sparc64, alpha, powerpc. This is a 2003-10-19 02:36:07 +00:00
sys Add the cpu_idle_hook() function pointer so that other idlers can be 2003-10-18 22:25:07 +00:00
tools Changes for new SMP-safe kobj method dispatch algorithm. 2003-10-16 13:29:26 +00:00
ufs DuH! 2003-10-18 14:10:28 +00:00
vm - Synchronize access to a vm page's valid field using the containing 2003-10-19 00:01:56 +00:00
Makefile Revert exclusion for amd64 that stopped boot/ being built. 2003-06-26 03:52:48 +00:00