freebsd-dev/sys
Jason A. Harmening 59409cb90f Add a generic mechanism for preventing forced unmount
This is aimed at preventing stacked filesystems like nullfs and unionfs
from "losing" their lower mounts due to forced unmount.  Otherwise,
VFS operations that are passed through to the lower filesystem(s) may
crash or otherwise cause unpredictable behavior.

Introduce two new functions: vfs_pin_from_vp() and vfs_unpin().
which are intended to be called on the lower mount(s) when the stacked
filesystem is mounted and unmounted, respectively.
Much as registration in the mnt_uppers list previously did, pinning
will prevent even forced unmount of the lower FS and will allow the
stacked FS to freely operate on the lower mount either by direct
use of the struct mount* or indirect use through a properly-referenced
vnode's v_mount field.

vfs_pin_from_vp() is modeled after vfs_ref_from_vp() in that it uses
the mount interlock coupled with re-checking vp->v_mount to ensure
that it will fail in the face of a pending unmount request, even if
the concurrent unmount fully completes.

Adopt these new functions in both nullfs and unionfs.

Reviewed By:	kib, markj
Differential Revision: https://reviews.freebsd.org/D30401
2021-06-05 18:20:36 -07:00
..
amd64 amd64: Clear the local TSS when creating a new thread 2021-06-01 19:38:22 -04:00
arm arm: allwinner: Add clock driver for Display Engine to the build 2021-06-02 10:17:16 +02:00
arm64 arm64/rk805: remove RTC Set logging 2021-06-05 17:07:56 +00:00
bsm
cam cam_sim: style: sort includes 2021-05-25 09:56:56 -06:00
cddl fbt: Remove some handling for multiple CTF containers 2021-04-02 17:49:13 -04:00
compat net80211/LinuxKPI: add more radiotap definitions 2021-06-05 16:21:49 +00:00
conf kmod.mk: Allow extra objects to be specified in modules 2021-06-02 10:39:58 -06:00
contrib Import ACPICA 20210604 2021-06-05 01:58:00 -04:00
crypto ossl: Use crypto_cursor_segment(). 2021-05-25 16:59:19 -07:00
ddb fix style nit: space after if 2021-05-05 15:26:09 -06:00
dev hyperv: register intr handler as usermode-mapped if loaded as module 2021-06-05 18:03:18 +03:00
dts arm64: rockchip: Add some DTSO to disable sd/mmc 2021-05-13 18:15:31 +02:00
fs Add a generic mechanism for preventing forced unmount 2021-06-05 18:20:36 -07:00
gdb gdb: report specific stop reason for watchpoints 2021-03-30 11:36:41 -03:00
geom gconcat: Add new lock to allow modifications to the disk list in preparation for online append 2021-06-02 15:59:25 -06:00
gnu
i386 i386: Make setidt_disp a size_t instead of uintptr_t 2021-06-01 19:37:50 -04:00
isa Remove more remnants of sio(4) 2021-04-07 14:33:02 -04:00
kern Add a generic mechanism for preventing forced unmount 2021-06-05 18:20:36 -07:00
kgssapi
libkern Use '.arch_extension crc' in the arm64 crc32 code 2021-05-06 07:42:35 +00:00
mips [mips/broadcom] set sysctl "hw.model" by SoC ChipCommon ID 2021-05-28 23:35:37 +03:00
modules dtb: rockchip: Add NanoPC-T4 to the build. 2021-06-05 15:19:26 +00:00
net kern: ether_gen_addr: randomize on default hostuuid, too 2021-06-01 22:59:21 -05:00
net80211 net80211/LinuxKPI: add more radiotap definitions 2021-06-05 16:21:49 +00:00
netgraph netgraph/ng_base: Renaming a node to the same name is a noop 2021-06-04 11:20:19 +02:00
netinet tcp: A better fix for the previously attempted fix of the ack-war issue with tcp. 2021-06-04 05:26:43 -04:00
netinet6 Enter the net epoch before calling ip6_setpktopts 2021-06-04 13:18:11 -04:00
netipsec Add missing sockaddr length and family validation to various protocols 2021-05-03 13:35:19 -04:00
netpfil dummynet: free(NULL, M_DUMMYNET); is safe 2021-06-03 09:02:53 +02:00
netsmb netsmb: Avoid a read-after-free in smb_t2_request_int() 2021-05-26 10:45:40 -04:00
nfs Fix panic when using BOOTP to resolve root path. 2021-03-28 14:02:40 -05:00
nfsclient nfs: Cleanup dead files 2021-03-17 06:16:31 +11:00
nfsserver nfs: Cleanup dead files 2021-03-17 06:16:31 +11:00
nlm
ofed OFED: migrate LinuxKPI net_device/ifnet macros into ofed 2021-05-27 12:26:01 +00:00
opencrypto cryptosoft: Use crypto_cursor_segment(). 2021-05-25 16:59:19 -07:00
powerpc powerpc: fix boot on pseries without hugepages 2021-06-02 16:27:36 -03:00
riscv arm64, riscv: remove reference to fsu_intr_fault 2021-05-25 12:26:52 -03:00
rpc nfsd: Fix the failure return for non-fh NFSv4 operations 2021-06-02 15:28:07 -07:00
security tcp_input/syncache: acquire only read lock on PCB for SYN,!ACK packets 2021-04-12 08:25:31 -07:00
sys Add a generic mechanism for preventing forced unmount 2021-06-05 18:20:36 -07:00
teken
tests Revise FIB lookups per second benchmarking routines. 2021-05-05 12:28:17 +02:00
tools makesyscalls.lua: improve generated file style(9) compliance 2021-05-13 13:59:25 -04:00
ufs ffs: Correct the input size check in sysctl_ffs_fsck() 2021-05-31 18:59:18 -04:00
vm vm: add another pager private flag 2021-05-15 20:47:29 +00:00
x86 Disable x2APIC for SandyBridge laptops with Samsung BIOS 2021-06-03 22:47:31 +03:00
xdr
xen x86/xen: remove PVHv1 code 2021-05-17 11:41:21 +02:00
Makefile