freebsd-dev/sys
Kirk McKusick bbb1e07d65 Peter Holm reports that his test that does an umount(8) on an active
mount point while numerous tests are running that are writing to
files on that mount point cause the unmount(8) to hang forever.

The unmount(8) system call is handled in the kernel by the dounmount()
function. The cause of the hang is that prior to dounmount() calling
VFS_UNMOUNT() it is calling VFS_SYNC(mp, MNT_WAIT). The MNT_WAIT
flag indicates that VFS_SYNC() should not return until all the dirty
buffers associated with the mount point have been written to disk.
Because user processes are allowed to continue writing and can do
so faster than the data can be written to disk, the call to VFS_SYNC()
can never finish.

Unlike VFS_SYNC(), the VFS_UNMOUNT() routine can suspend all processes
when they request to do a write thus having a finite number of dirty
buffers to write that cannot be expanded. There is no need to call
VFS_SYNC() before calling VFS_UNMOUNT(), because VFS_UNMOUNT() needs
to flush everything again anyway after suspending writes, to catch
anything that was dirtied between the VFS_SYNC() and writes being
suspended.

The fix is to simply remove the unnecessary call to VFS_SYNC() from
dounmount().

Reported by:  Peter Holm
Analysis by:  Chuck Silvers
Tested by:    Peter Holm
MFC after:    7 days
Sponsored by: Netflix
2020-01-15 18:53:32 +00:00
..
amd64 Set .ORDER for makesyscalls generated files 2020-01-10 18:24:17 +00:00
arm Add KERNEL_PANICKED macro for use in place of direct panicstr tests 2020-01-12 06:07:54 +00:00
arm64 Set .ORDER for makesyscalls generated files 2020-01-10 18:24:17 +00:00
bsm Jail and capability mode for shm_rename; add audit support for shm_rename 2019-11-18 13:31:16 +00:00
cam Const-poison the cam_sim_* convenience accessor functions. 2020-01-09 16:34:54 +00:00
cddl Map ECKSUM and EFRAGS from ZFS onto real errnos. 2020-01-13 22:06:16 +00:00
compat Handle a NULL thread pointer in linux_close_file(). 2020-01-15 15:31:35 +00:00
conf mips trampoline: don't bother with unwind tables 2020-01-15 15:59:32 +00:00
contrib MFV: r356607 2020-01-10 22:49:14 +00:00
crypto Fix the armv8 crypto driver after r354170. 2019-10-30 10:41:10 +00:00
ddb Add KERNEL_PANICKED macro for use in place of direct panicstr tests 2020-01-12 06:07:54 +00:00
dev storvsc: port a Linux patch, properly set residual data length on errors 2020-01-14 13:20:16 +00:00
dts arm64: allwinner: dtso: Add spi0 spigen DTSO 2020-01-11 18:36:10 +00:00
fs tmpfs: add missing CLTFLAG_MPSAFE annotation 2020-01-15 01:32:11 +00:00
gdb Add KERNEL_PANICKED macro for use in place of direct panicstr tests 2020-01-12 06:07:54 +00:00
geom Add KERNEL_PANICKED macro for use in place of direct panicstr tests 2020-01-12 06:07:54 +00:00
gnu Import DTS files for riscv from Linux 5.4 2019-12-03 09:12:53 +00:00
i386 Set .ORDER for makesyscalls generated files 2020-01-10 18:24:17 +00:00
isa sc(4) md bits: stop setting sc->kbd entirely 2019-12-30 02:07:55 +00:00
kern Peter Holm reports that his test that does an umount(8) on an active 2020-01-15 18:53:32 +00:00
kgssapi Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
libkern random(9): Deprecate random(9), remove meaningless srandom(9) 2019-12-26 19:41:09 +00:00
mips Preserve the inherited value of the status register in cpu_set_upcall(). 2020-01-14 18:00:04 +00:00
modules arm64: allwinner: dtso: Add spi0 spigen DTSO 2020-01-11 18:36:10 +00:00
net gif_transmit() must always be called in the network epoch. 2020-01-15 06:18:32 +00:00
net80211 Don't use if_maddr_rlock() in 802.11, use epoch(9) directly instead. 2019-10-10 23:55:33 +00:00
netgraph Netgraph queue processing thread must process all its items 2020-01-15 03:35:57 +00:00
netinet A miss from r356754. 2020-01-15 06:12:39 +00:00
netinet6 Introduce NET_EPOCH_CALL() macro and use it everywhere where we free 2020-01-15 06:05:20 +00:00
netipsec Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros. 2019-12-01 00:22:04 +00:00
netpfil Introduce NET_EPOCH_CALL() macro and use it everywhere where we free 2020-01-15 06:05:20 +00:00
netsmb Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
nfs vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
nfsclient
nfsserver
nlm vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
ofed Make sure the VNET is properly set when reaping mbufs in ipoib. 2020-01-11 12:02:16 +00:00
opencrypto Add stricter checking on mac key lengths. 2020-01-09 18:29:59 +00:00
powerpc powerpc/mpc85xx: Partially revert r356640 2020-01-13 23:09:00 +00:00
riscv RISC-V: fix global symbol lookups for mpentry with lld 2020-01-13 03:39:02 +00:00
rpc Change r355157 to make svc_rpc_gss_lifetime_max a static. 2019-11-28 02:18:51 +00:00
security vfs: eliminate v_tag from struct vnode 2020-01-07 04:29:34 +00:00
sparc64 Add KERNEL_PANICKED macro for use in place of direct panicstr tests 2020-01-12 06:07:54 +00:00
sys Introduce NET_EPOCH_CALL() macro and use it everywhere where we free 2020-01-15 06:05:20 +00:00
teken Adjust teken to allow build as part of loader 2019-09-05 18:07:40 +00:00
tests
tools makesyscalls.lua: generate all files in /tmp, write into place at the end 2020-01-10 18:22:14 +00:00
ufs When sync'ing a mount point, the mount point's vnodes were scanned 2020-01-14 22:27:46 +00:00
vm Restore loop break in vm_pageout_lowmem(). 2020-01-14 03:27:57 +00:00
x86 Add KERNEL_PANICKED macro for use in place of direct panicstr tests 2020-01-12 06:07:54 +00:00
xdr
xen
Makefile