freebsd-skq/sys
Mateusz Guzik 68ac2b804c vfs: fix vnode reclaim races against getnwevnode
All vnodes allocated by UMA are present on the global list used by
vnlru. getnewvnode modifies the state of the vnode (most notably
altering v_holdcnt) but never locks it. Moreover filesystems also
modify it in arbitrary manners sometimes before taking the vnode
lock or adding any other indicator that the vnode can be used.

Picking up such a vnode by vnlru would be problematic.

To that end there are 2 fixes:
- vlrureclaim, not recycling v_holdcnt == 0 vnodes, takes the
interlock and verifies that v_mount has been set. It is an
invariant that the vnode lock is held by that point, providing
the necessary serialisation against locking after vhold.
- vnlru_free_locked, only wanting to free v_holdcnt == 0 vnodes,
now makes sure to only transition the count 0->1 and newly allocated
vnodes start with v_holdcnt == VHOLD_NO_SMR. getnewvnode will only
transition VHOLD_NO_SMR->1 once more making the hold fail

Tested by:	pho
2020-10-27 18:12:07 +00:00
..
amd64 Fix misnomer - linux_to_bsd_errno() does the exact opposite. 2020-10-27 12:49:40 +00:00
arm Simplify preload_dump() condition 2020-10-15 20:21:15 +00:00
arm64 o Add the domain member to the struct bus_dma_tag_common as required by 2020-10-27 15:29:53 +00:00
bsm
cam Introduce support of SCSI Command Priority. 2020-10-25 19:34:02 +00:00
cddl Fix build after r367020 2020-10-24 23:21:51 +00:00
compat Fix misnomer - linux_to_bsd_errno() does the exact opposite. 2020-10-27 12:49:40 +00:00
conf backlight(9): compile with COMPAT_LINUXKPI as well 2020-10-24 15:38:04 +00:00
contrib zfs: remove unused support for zfs_znode_move 2020-10-26 08:17:41 +00:00
crypto Add a new CCP device ID found on my Ryzen 5 3600XT. 2020-10-22 17:46:55 +00:00
ddb db_search_symbol: prevent pollution from bogus symbols 2020-10-26 16:42:53 +00:00
dev Introduce support of SCSI Command Priority. 2020-10-25 19:34:02 +00:00
dts Brand our DTS with the Linux version it was imported from 2020-10-10 07:18:51 +00:00
fs vfs: drop spurious cache_purge on rmdir 2020-10-23 15:50:49 +00:00
gdb gdb(4): Don't escape GDB special characters at application layer 2020-09-30 14:55:54 +00:00
geom Remove frontstuff 2020-10-27 06:43:24 +00:00
gnu Brand our DTS with the Linux version it was imported from 2020-10-10 07:18:51 +00:00
i386 Fix misnomer - linux_to_bsd_errno() does the exact opposite. 2020-10-27 12:49:40 +00:00
isa
kern vfs: fix vnode reclaim races against getnwevnode 2020-10-27 18:12:07 +00:00
kgssapi State kgssapi dependency on xdr. 2020-09-17 22:29:38 +00:00
libkern arc4random(9): Integrate with RANDOM_FENESTRASX push-reseed 2020-10-10 21:48:06 +00:00
mips Avoid dump_avail[] redefinition. 2020-10-14 22:51:40 +00:00
modules Factor out generic IP over infiniband, IPoIB, definitions and code 2020-10-22 09:09:53 +00:00
net More style fixes (partial revert of r366994). 2020-10-24 13:07:50 +00:00
net80211 net80211: factor out the priv(9) checks into OS specifc code. 2020-10-18 21:34:04 +00:00
netgraph ng_l2tp: Fix callout synchronization in the rexmit timeout handler 2020-09-25 18:55:50 +00:00
netinet TCP Cubic: improve reaction to (and rollback from) RTO 2020-10-24 16:11:46 +00:00
netinet6 icmp6: Count packets dropped due to an invalid hop limit 2020-10-19 17:07:19 +00:00
netipsec Trigger soft lifetime expiration on sequence number 2020-10-16 11:27:01 +00:00
netpfil Add dtrace SDT probe ipfw:::rule-matched. 2020-10-21 15:01:33 +00:00
netsmb net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
nfs nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsclient nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsserver nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nlm nlm: clean up empty lines in .c and .h files 2020-09-01 22:14:52 +00:00
ofed Factor out generic IP over infiniband, IPoIB, definitions and code 2020-10-22 09:09:53 +00:00
opencrypto Fix a couple of bugs for asym crypto introduced in r359374. 2020-10-19 20:04:03 +00:00
powerpc Avoid dump_avail[] redefinition. 2020-10-14 22:51:40 +00:00
riscv riscv: Minor cleanup in startup code 2020-10-27 12:44:49 +00:00
rpc Fix a potential memory leak in the NFS over TLS handling code. 2020-09-05 00:50:52 +00:00
security mac_framework.h: fix build with DEBUG_VFS_LOCKS and !MAC 2020-09-03 20:30:52 +00:00
sys refcount: make it atomic-clean 2020-10-27 18:11:11 +00:00
teken Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00
tests Add small tool to invoke kernel test framework tests. 2020-09-02 09:20:40 +00:00
tools Brand our DTS with the Linux version it was imported from 2020-10-10 07:18:51 +00:00
ufs Various new check-hash checks have been added to the UFS filesystem 2020-10-25 00:43:48 +00:00
vm Conditionally compile struct vm_phys_seg's md_first field. This field is 2020-10-23 06:24:38 +00:00
x86 Move the iommu stubs to a generic place, so they are available on all the 2020-10-23 21:27:48 +00:00
xdr xdr: clean up empty lines in .c and .h files 2020-09-01 22:13:28 +00:00
xen xen: clean up empty lines in .c and .h files 2020-09-01 21:21:55 +00:00
Makefile