Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Aug 2025 15:22:51 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d033848a5e4c - stable/14 - ufs: Remove uses of DEBUG_VFS_LOCKS
Message-ID:  <202508251522.57PFMp4w053920@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=d033848a5e4ca02b20c55b8e8601c57087dafb81

commit d033848a5e4ca02b20c55b8e8601c57087dafb81
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-07-24 15:27:56 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-08-25 13:57:56 +0000

    ufs: Remove uses of DEBUG_VFS_LOCKS
    
    All of these assertions can reasonably be checked when plain INVARIANTS
    is configured, there's no need to configure a separate option.
    
    Reviewed by:    olce, imp, kib
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D51696
    
    (cherry picked from commit 4798f1e8f28d1bd440987696b3474eb6ca764fde)
---
 sys/ufs/ffs/ffs_softdep.c | 2 --
 sys/ufs/ffs/ffs_vnops.c   | 2 --
 sys/ufs/ufs/ufs_lookup.c  | 2 --
 sys/ufs/ufs/ufs_quota.c   | 4 ----
 4 files changed, 10 deletions(-)

diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 54a0466da88c..70807552c8c8 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -14528,10 +14528,8 @@ getdirtybuf(struct buf *bp,
 		BUF_UNLOCK(bp);
 		if (waitfor != MNT_WAIT)
 			return (NULL);
-#ifdef DEBUG_VFS_LOCKS
 		if (bp->b_vp->v_type != VCHR)
 			ASSERT_BO_WLOCKED(bp->b_bufobj);
-#endif
 		bp->b_vflags |= BV_BKGRDWAIT;
 		rw_sleep(&bp->b_xflags, lock, PRIBIO, "getbuf", 0);
 		return (NULL);
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 03dcb27ff6f7..bf90387ccd59 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -511,9 +511,7 @@ ffs_lock(
 	case LK_EXCLUSIVE:
 		flags = ap->a_flags;
 		for (;;) {
-#ifdef DEBUG_VFS_LOCKS
 			VNPASS(vp->v_holdcnt != 0, vp);
-#endif	/* DEBUG_VFS_LOCKS */
 			lkp = vp->v_vnlock;
 			result = lockmgr_lock_flags(lkp, flags,
 			    &VI_MTX(vp)->lock_object, ap->a_file, ap->a_line);
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index 423c4c2e4e28..af348157c87d 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -232,7 +232,6 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp,
 
 	bmask = VFSTOUFS(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1;
 
-#ifdef DEBUG_VFS_LOCKS
 	/*
 	 * Assert that the directory vnode is locked, and locked
 	 * exclusively for the last component lookup for modifying
@@ -250,7 +249,6 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp,
 	if ((nameiop == CREATE || nameiop == DELETE || nameiop == RENAME) &&
 	    (flags & (LOCKPARENT | ISLASTCN)) == (LOCKPARENT | ISLASTCN))
 		ASSERT_VOP_ELOCKED(vdp, "ufs_lookup2");
-#endif
 
 restart:
 	bp = NULL;
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 52fc6c08fdf9..f9427a5f152c 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -1280,10 +1280,8 @@ dqget(struct vnode *vp, uint64_t id, struct ufsmount *ump, int type,
 	struct uio auio;
 	int dqvplocked, error;
 
-#ifdef DEBUG_VFS_LOCKS
 	if (vp != NULLVP)
 		ASSERT_VOP_ELOCKED(vp, "dqget");
-#endif
 
 	if (vp != NULLVP && *dqp != NODQUOT) {
 		return (0);
@@ -1555,10 +1553,8 @@ dqsync(struct vnode *vp, struct dquot *dq)
 	struct mount *mp;
 	struct ufsmount *ump;
 
-#ifdef DEBUG_VFS_LOCKS
 	if (vp != NULL)
 		ASSERT_VOP_ELOCKED(vp, "dqsync");
-#endif
 
 	mp = NULL;
 	error = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202508251522.57PFMp4w053920>