freebsd-skq/sys
attilio 697e2a94e4 1) Fix a deadlock in the VFS:
- threadA runs vfs_rel(mp1)
- threadB does unmount the mp1 fs, sets MNTK_UNMOUNT and drop MNT_ILOCK()
- threadA runs vfs_busy(mp1) and, as long as, MNTK_UNMOUNT is set, sleeps
  waiting for threadB to complete the unmount
- threadB, in vfs_mount_destroy(), finds mnt_lock > 0 and sleeps waiting
  for the refcount to expire.

Fix the deadlock by adding a flag called MNTK_REFEXPIRE which signals the
unmounter is waiting for mnt_ref to expire.
The vfs_busy contenders got awake, fails, and if they retry the
MNTK_REFEXPIRE won't allow them to sleep again.

2) Simplify significantly the code of vfs_mount_destroy() trimming
   unnecessary codes:
   - as long as any reference exited, it is no-more possible to have
     write-op (primarty and secondary) in progress.
   - it is no needed to drop and reacquire the mount lock.
   - filling the structures with dummy values is unuseful as long as
     it is going to be freed.

Tested by:	pho, Andrea Barberio <insomniac at slackware dot it>
Discussed with:	kib
2008-12-16 23:16:10 +00:00
..
amd64 Bug fix: %ebx needs to be preserved in the user callchain capture 2008-12-14 09:06:28 +00:00
arm Avoid confusion and adjust link address range of Marvell Orion kernel so it is 2008-12-05 15:31:51 +00:00
boot Disconnect the efi from pc98. It's not needed. 2008-12-14 02:57:41 +00:00
bsm Merge OpenBSM 1.1 alpha 2 from the OpenBSM vendor branch to head, both 2008-12-02 23:26:43 +00:00
cam Fix locking in periph drivers - don't try to unlock periph 2008-12-16 17:01:52 +00:00
cddl Put the MIPS support back in after it was removed in r185029. 2008-12-04 16:31:08 +00:00
compat Reference the vmspace of the process being inspected by procfs, linprocfs 2008-12-12 12:12:36 +00:00
conf Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular, 2008-12-15 15:31:10 +00:00
contrib This main goals of this project are: 2008-12-15 06:10:57 +00:00
crypto Avoid 256 integer divisions per rc4_init() call. Replace it with using 2008-12-16 13:58:37 +00:00
ddb Collect N identical (or near identical) mkdumpheader() implementations into 2008-10-01 22:08:53 +00:00
dev Fix forced mdconfig -du. E.g. the following would previously 2008-12-16 20:59:27 +00:00
fs According to phk@, VOP_STRATEGY should never, _ever_, return 2008-12-16 21:13:11 +00:00
gdb
geom Implement g_vfs_orphan(). Without it, the filesystem never closes 2008-12-16 17:04:52 +00:00
gnu According to phk@, VOP_STRATEGY should never, _ever_, return 2008-12-16 21:13:11 +00:00
i386 - Bug fix: prevent a thread from migrating between CPUs between the 2008-12-13 13:07:12 +00:00
ia64 Remove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important. 2008-12-02 19:09:08 +00:00
isa Allow device hints to wire the unit numbers of devices. 2008-11-18 21:01:54 +00:00
kern 1) Fix a deadlock in the VFS: 2008-12-16 23:16:10 +00:00
kgssapi Call svc_freereq() before returning from the service proc. 2008-11-12 15:31:05 +00:00
libkern Add simple locking for the in-kernel iconv code. Translation operations 2008-12-05 21:19:24 +00:00
mips Start to clean up the MIPS elf machine dependent file. 2008-12-16 20:07:47 +00:00
modules This main goals of this project are: 2008-12-15 06:10:57 +00:00
net Also propagate the if_hwassist value to the parent so that cksum offload works. 2008-12-16 22:16:34 +00:00
net80211 fix comment 2008-12-16 01:17:36 +00:00
netatalk Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
netgraph Unroll two loops of SHA1Update(). 60 bytes of static memory is not a price. 2008-12-16 19:15:31 +00:00
netinet IPFW's pfil hook/unhook code ignores the return values of pfil_add_hook() 2008-12-16 15:05:35 +00:00
netinet6 - Simplify handling of the deferring of mbuf transmit until after lle lock drop 2008-12-16 23:06:36 +00:00
netipsec Another step assimilating IPv[46] PCB code - directly use 2008-12-15 21:50:54 +00:00
netipx Add missing "goto set_head" for SO_IPX_CHECKSUM; otherwise we fall through 2008-12-11 10:29:35 +00:00
netnatm Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
netncp Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
netsmb Implement device cloning for /dev/nsmb, the netsmb control pseudo-device. 2008-11-03 14:23:15 +00:00
nfs
nfs4client Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessary 2008-10-28 13:44:11 +00:00
nfsclient Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
nfsserver Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition 2008-12-16 04:34:09 +00:00
nlm Don't call svc_freereq() before svc_freeargs(). 2008-11-12 15:30:30 +00:00
opencrypto Don't hang if encrypting/decrypting using struct iovecs where one of the 2008-10-30 16:11:07 +00:00
pc98 Remove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important. 2008-12-02 19:09:08 +00:00
pccard
pci By default assume a 8139 chip if the EEPROM contents prove inconclusive. The 2008-12-15 21:54:23 +00:00
powerpc Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular, 2008-12-15 15:31:10 +00:00
rpc Add a missing call to mtx_destroy(). 2008-11-12 12:21:18 +00:00
security Merge OpenBSM 1.1 alpha 2 from the OpenBSM vendor branch to head, both 2008-12-02 23:26:43 +00:00
sparc64 Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular, 2008-12-15 15:31:10 +00:00
sun4v Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular, 2008-12-15 15:31:10 +00:00
sys 1) Fix a deadlock in the VFS: 2008-12-16 23:16:10 +00:00
tools Remove some unused and broken code that attempted to not invoke locking 2008-11-03 19:57:40 +00:00
ufs According to phk@, VOP_STRATEGY should never, _ever_, return 2008-12-16 21:13:11 +00:00
vm Instead of forcing vn_start_write() to reset mp back to NULL for the 2008-11-16 21:57:54 +00:00
xdr Use the remote address for access control, not the local address. This fixes 2008-11-13 14:36:52 +00:00
xen Integrate 185578 from dfr 2008-12-04 07:59:05 +00:00
Makefile