freebsd-skq/sys/ufs/ffs
kib 38508e2c91 VFS sometimes is unable to inactivate a vnode when vnode use count
goes to zero. E.g., the vnode might be only shared-locked at the time of
vput() call. Such vnodes are kept in the hash, so they can be found later.

If ffs_valloc() allocated an inode that has its vnode cached in hash, and
still owing the inactivation, then vget() call from ffs_valloc() clears
VI_OWEINACT, and then the vnode is reused for the newly allocated inode.

The problem is, the vnode is not reclaimed before it is put to the new
use. ffs_valloc() recycles vnode vm object, but this is not enough.
In particular, at least v_vflag should be cleared, and several bits of
UFS state need to be removed.

It is very inconvenient to call vgone() at this point. Instead, move
some parts of ufs_reclaim() into helper function ufs_prepare_reclaim(),
and call the helper from VOP_RECLAIM and ffs_valloc().

Reviewed by:	mckusick
Tested by:	pho
MFC after:	3 weeks
2011-04-24 10:47:56 +00:00
..
ffs_alloc.c VFS sometimes is unable to inactivate a vnode when vnode use count 2011-04-24 10:47:56 +00:00
ffs_balloc.c - Merge soft-updates journaling from projects/suj/head into head. This 2010-04-24 07:05:35 +00:00
ffs_extern.h Be far more persistent in reclaiming blocks and inodes before giving 2011-04-05 21:26:05 +00:00
ffs_inode.c Add function lbn_offset to calculate offset of the indirect block of 2010-11-11 11:35:42 +00:00
ffs_rawread.c Put the general logic for being a CPU hog into a new function 2011-02-02 16:35:10 +00:00
ffs_snapshot.c Add some FEATURE macros for some UFS features. 2011-02-09 15:33:13 +00:00
ffs_softdep.c - Refactor softdep_setup_freeblocks() into a set of functions to prepare 2011-04-11 01:43:59 +00:00
ffs_subr.c - Merge soft-updates journaling from projects/suj/head into head. This 2010-04-24 07:05:35 +00:00
ffs_tables.c
ffs_vfsops.c Retire opt_ffs_broken_fixme.h. 2011-03-20 21:05:09 +00:00
ffs_vnops.c - Handle the truncation of an inode with an effective link count of 0 in 2010-07-06 07:11:04 +00:00
fs.h Use the native sector size of the device backing the UFS volume for SU+J 2011-02-12 12:52:12 +00:00
softdep.h Fix a long standing SUJ performance problem: 2011-04-10 03:49:53 +00:00