freebsd-dev/sys
Andriy Gapon 0f7dcde977 fix deadlock-prone code in getzfsvfs()
getzfsvfs() called vfs_busy() in the waiting mode while having a hold on
a pool (via a call to dmu_objset_hold).  In other words,
dp_config_rwlock was held in the shared mode while a thread could be
sleeping in vfs_busy().
The pool's txg sync thread needs to take dp_config_rwlock in the
exclusive mode for some actions, e.g., for executing sync tasks.  If the
sync thread gets blocked, then any thread waiting for its sync task to
get executed is also blocked.  Which, in turn, could mean that
vfs_busy() will keep waiting indefinitely.

The solution is to use vfs_ref() in the locked section and to call
vfs_busy() only after dropping other locks.
Note that a reference on a struct mount object does not prevent an
associated zfsvfs_t object from being destroyed.  So, we have to be
careful to operate only on the struct mount object until we successfully
vfs_busy it.

Approved by:	re (gjb)
MFC after:	2 weeks
2016-06-23 07:01:54 +00:00
..
amd64 Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
arm Revert the recent armv6 changes to ALIGNED_POINTER(), restoring the 2016-06-21 17:53:42 +00:00
arm64 Fix a race when the hardware has raised an exception with an unknown or 2016-06-22 12:05:08 +00:00
boot Print a message when disks are found but no logical partition are 2016-06-17 17:09:22 +00:00
bsm
cam Commit the bits of nda that were missed. This should fix the build. 2016-06-10 06:04:53 +00:00
cddl fix deadlock-prone code in getzfsvfs() 2016-06-23 07:01:54 +00:00
compat Regen post r302096 and implement svr4_pipe(). 2016-06-23 00:30:09 +00:00
conf META_MODE: Don't generate or read _EXTRADEPEND dependencies when using filemon. 2016-06-21 21:55:03 +00:00
contrib Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
crypto Connect the SHA-512t256 and Skein hashing algorithms to ZFS 2016-05-31 04:12:14 +00:00
ddb Add a small set of logical operators to DDB command language. 2016-05-16 19:42:38 +00:00
dev cxgbe(4): Merge netmap support from the ncxgbe/ncxl interfaces to the 2016-06-23 02:53:00 +00:00
fs Do not access NFS data for reclaimed vnode. 2016-06-19 18:29:43 +00:00
gdb
geom Do not complete pending gmirror BIOs when tearing down the provider. 2016-06-22 21:00:28 +00:00
gnu Revert changes for local testing, inadvertantly commited in r300811. 2016-05-26 23:59:42 +00:00
i386 Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
isa
kern Generate syscall tables and update pipe() implementation after r302094. 2016-06-22 21:18:19 +00:00
kgssapi
libkern
mips Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
modules Change the default build behavior so we don't compile extra TCP modules by 2016-06-10 19:06:11 +00:00
net Add more fields to if_debug.c for ddb(4) 'show ifnet'; resort 2016-06-22 12:53:10 +00:00
net80211 [net80211] remove node scan lock / generation number + fix few LORs 2016-06-19 07:31:02 +00:00
netgraph Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
netinet Check the V_tcbinfo.ipi_count to hit 0 before doing the full TCP cleanup. 2016-06-23 00:34:03 +00:00
netinet6 Fix the NULL pointer dereference for unresolved link layer entries in 2016-06-22 11:29:21 +00:00
netipsec Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
netnatm
netpfil Import a fix for and old security issue (CVE-2010-3830) in pf which 2016-06-23 05:41:46 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm Remote and local adv lock servers might de-synchronize (the added comment 2016-06-19 18:32:35 +00:00
ofed Fix bug in iwcm that caused a panic in iw_cm_wq when krping is run 2016-06-14 20:58:05 +00:00
opencrypto
pc98
powerpc Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
riscv Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
rpc Deobfuscate cleanup path in clnt_bck_create(..) 2016-06-10 17:53:28 +00:00
security Implement AUE_PREAD and AUE_PWRITE BSM conversion support, eliminating 2016-06-13 09:22:20 +00:00
sparc64 Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
sys Generate syscall tables and update pipe() implementation after r302094. 2016-06-22 21:18:19 +00:00
teken
tests
tools
ufs arc4random() returns 0 to (2**32)−1, use an alternative to initialize 2016-05-22 14:31:20 +00:00
vm Fix a LOR between vnode locks and allproc_lock. 2016-06-22 20:15:37 +00:00
x86 Trim some spaces to record correct commit message for the r301278. 2016-06-03 18:23:45 +00:00
xdr
xen xen: Correct typo in #undef for symbol NBPL 2016-06-06 14:55:46 +00:00
Makefile