freebsd-dev/sys/ufs/ffs
Konstantin Belousov 4085590d39 ufs: do not leave non-reclaimed vnodes with zero i_mode around.
After a recent change, vput() relocks even the exclusively locked
vnode before inactivating it.  Before that, UFS could safely
instantiate a vnode for cleared inode, then the last vput() after
ffs_vgetf() noted that ip->i_mode == 0 and recycled.  Now, it is
possible for other threads to note the half-constructed vnode, e.g. to
insert it into hash, which makes other threads to use it despite mode
is zero, before inactivation and reclaim.

Handle the found cases in SU code, by explicitly doing reclaim.
Assert that other places get fully constructed inode from ffs_vgetf(),
which cannot be cleared before dependencies are resolved.

Reported and tested by:	pho
Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-12-27 16:43:34 +00:00
..
ffs_alloc.c Currently the breadn_flags() and getblkx() interfaces are passed 2019-12-03 23:07:09 +00:00
ffs_balloc.c
ffs_extern.h
ffs_inode.c vfs: introduce v_irflag and make v_type smaller 2019-12-08 21:30:04 +00:00
ffs_rawread.c vfs: introduce v_irflag and make v_type smaller 2019-12-08 21:30:04 +00:00
ffs_snapshot.c As part of creating a snapshot, set fs->fs_fmod to 0 in the snapshot image 2019-11-28 00:37:43 +00:00
ffs_softdep.c ufs: do not leave non-reclaimed vnodes with zero i_mode around. 2019-12-27 16:43:34 +00:00
ffs_subr.c
ffs_suspend.c
ffs_tables.c
ffs_vfsops.c ufs: add root vnode caching 2019-10-06 22:18:03 +00:00
ffs_vnops.c vfs: flatten vop vectors 2019-12-16 00:06:22 +00:00
fs.h
softdep.h