freebsd-dev/sys
Konstantin Belousov 714b7df502 Provide simple mutual exclusion between mount point update and unmount.
Currently mount update keeps vfs_busy(9) reference on the mount point
during MNT_UPDATE VFS_MOUNT() vfsops call.  This already provides the
exclusion, but is problematic for filesystems which need to perform
namei(9) during VFS_MOUNT(MNT_UPDATE) operations, e.g. to refresh
mnt_from path, because namei(9) must not be called while the
vfs_busy(9) reference is owned.

Check for MNT_UPDATE flag before setting MNTK_UNMOUNT, and for
MNTK_UNMOUNT before entering innards of vfs_domount_update(), failing
syscalls with EBUSY if conflict is detected.  Keep vfs_busy(9)
reference around VFS_MOUNT(MNT_UPDATE) calls still to not change VFS
KPI.

In the update path in ffs_mount(), drop vfs_busy() reference around
namei(), which is now safe due to unmount never executing in parallel
with VFS_MOUNT(MNT_UPDATE), and which avoids the deadlock.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2016-11-13 21:49:51 +00:00
..
amd64 Fix improper use of "its". 2016-11-08 23:59:41 +00:00
arm The return type of is_managed() was changed from boolean_t to bool type 2016-11-12 17:24:41 +00:00
arm64 Fix improper use of "its". 2016-11-08 23:59:41 +00:00
boot Make dpaa work with only slightly modified Linux device trees. 2016-11-12 20:45:03 +00:00
bsm
cam Fix improper use of "its". 2016-11-08 23:59:41 +00:00
cddl Remove the DTrace printt and typeref actions. 2016-11-12 19:26:12 +00:00
compat Tidy up ia32_sysvec sv_flags setting 2016-10-20 20:29:54 +00:00
conf Allow embeding DRM2 code into kernel. 2016-11-13 16:31:23 +00:00
contrib Fix improper use of "its". 2016-11-08 23:59:41 +00:00
crypto Fix C++ includability of crypto headers with static array sizes 2016-10-18 23:20:49 +00:00
ddb Determine the operand/address size of %cs in a new function 2016-09-25 16:30:29 +00:00
dev Allow DRM2 code to be built on platforms without AGP. 2016-11-13 13:31:23 +00:00
fs Remove spurious space. 2016-11-13 12:06:25 +00:00
gdb
geom Use providergone method to cover race between destroy and g_access(). 2016-11-13 03:56:26 +00:00
gnu Revert and redo r306083. 2016-09-22 15:17:36 +00:00
i386 Fix improper use of "its". 2016-11-08 23:59:41 +00:00
isa
kern Provide simple mutual exclusion between mount point update and unmount. 2016-11-13 21:49:51 +00:00
kgssapi
libkern
mips Use the new ofw_bus_node_is_compatible function in the mips code. 2016-11-13 09:33:41 +00:00
modules [rpi_ft5406] Add missing dependency on mbox_if.h 2016-11-12 19:05:41 +00:00
net Don't read if_counters with if_addr_lock held 2016-11-12 19:03:23 +00:00
net80211 [net80211] implement "first RX defines the BAW" hack. 2016-11-10 18:36:40 +00:00
netgraph Fix improper use of "its". 2016-11-08 23:59:41 +00:00
netinet Initialize ip6 pointer before use. 2016-11-06 02:33:04 +00:00
netinet6 Make ICMPv6 hard error handling for TCP consistent with the ICMPv4 2016-10-21 10:32:57 +00:00
netipsec Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead. 2016-09-15 07:41:48 +00:00
netnatm
netpfil Remove the mbuf tag after use (for reinjected packets). 2016-11-03 00:26:58 +00:00
netsmb
nfs Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
nfsclient
nfsserver
nlm
ofed Move the ConnectX-3 and ConnectX-2 driver from sys/ofed into sys/dev/mlx4 2016-09-30 08:23:06 +00:00
opencrypto Add support for the fpu_kern(9) KPI on arm64. It hooks into the existing 2016-10-20 09:22:10 +00:00
pc98 Fix building on i386 and arm. But 'public domain' headers on the files 2016-10-13 06:56:23 +00:00
powerpc Make dpaa work with only slightly modified Linux device trees. 2016-11-12 20:45:03 +00:00
riscv System Binary Interface (SBI) page was moved in latest version of 2016-11-04 13:07:54 +00:00
rpc Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
security Fix improper use of "its". 2016-11-08 23:59:41 +00:00
sparc64 Fix building on i386 and arm. But 'public domain' headers on the files 2016-10-13 06:56:23 +00:00
sys queue.3: Document existing QMD_* macros 2016-11-11 20:44:33 +00:00
teken
tests
tools Consider CROSS_BINUTILS_PREFIX environment variable so we use correct 2016-08-10 13:49:17 +00:00
ufs Provide simple mutual exclusion between mount point update and unmount. 2016-11-13 21:49:51 +00:00
vm Introduce a new page queue, PQ_LAUNDRY, for storing unreferenced, dirty 2016-11-09 18:48:37 +00:00
x86 Fix improper use of "its". 2016-11-08 23:59:41 +00:00
xdr
xen xen: add a grant-table user-space device 2016-10-31 13:12:58 +00:00
Makefile