ufs: relax an overzealous assert added in r356671

Part of i_flag can persist across a drop to hold count of 0, at which
point the vnode is taken off the lazy list. Then whoever locks and unlocks
the vnode can trip on the assert.

This trips over kyua running a test untarring character devices to ufs.

Reported by:	lwhsu
This commit is contained in:
Mateusz Guzik 2020-01-13 14:33:51 +00:00
parent fedab1b499
commit f1fcaffd8e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356683
2 changed files with 7 additions and 1 deletions

View File

@ -485,7 +485,7 @@ ffs_unlock_debug(struct vop_unlock_args *ap)
struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
if (ip->i_flag & UFS_INODE_FLAG_LAZY_MASK) {
if (ip->i_flag & UFS_INODE_FLAG_LAZY_MASK_ASSERTABLE) {
if ((vp->v_mflag & VMP_LAZYLIST) == 0) {
VI_LOCK(vp);
VNASSERT((vp->v_mflag & VMP_LAZYLIST), vp,

View File

@ -140,6 +140,12 @@ struct inode {
#define UFS_INODE_FLAG_LAZY_MASK \
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE | IN_LAZYMOD | IN_LAZYACCESS)
/*
* Some flags can persist a vnode transitioning to 0 hold count and being tkaen
* off the list.
*/
#define UFS_INODE_FLAG_LAZY_MASK_ASSERTABLE \
(UFS_INODE_FLAG_LAZY_MASK & ~(IN_LAZYMOD | IN_LAZYACCESS))
#define UFS_INODE_SET_FLAG(ip, flags) do { \
struct inode *_ip = (ip); \