aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-01-31 19:01:17 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-02-12 01:02:22 +0000
commit26af9f72f7cb162abeced8b7e444800b601e5017 (patch)
tree211dc3d07d5576a193f19ddddf2522a1545d58b7
parent28703d27130c9cb7e7830ff53155c379a502c248 (diff)
downloadsrc-26af9f72f7cb162abeced8b7e444800b601e5017.tar.gz
src-26af9f72f7cb162abeced8b7e444800b601e5017.zip
ffs_unlock: assert that IN_ENDOFF is not leaked past locked scope
This catches both missed processing of IN_ENDOFF and missed application of VOP_VPUT_PAIR() after VOP that created an entry in the directory. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/ufs/ffs/ffs_vnops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 38511647c502..1dfdf5182a42 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -591,6 +591,9 @@ ffs_unlock_debug(struct vop_unlock_args *ap)
VI_UNLOCK(vp);
}
}
+ KASSERT(vp->v_type != VDIR || vp->v_vnlock->lk_recurse != 0 ||
+ (ip->i_flag & IN_ENDOFF) == 0,
+ ("ufs dir vp %p ip %p flags %#x", vp, ip, ip->i_flag));
#ifdef DIAGNOSTIC
if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE && ip != NULL &&
vp->v_vnlock->lk_recurse == 0)