Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jun 2022 18:32:12 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 1e54362824f6 - main - vfs_op_exit(): assert that mnt_vfs_ops stays non-zero for unmount or suspend
Message-ID:  <202206291832.25TIWC6T051687@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

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

commit 1e54362824f62a9d43585e94422d1d3d5f0268f9
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-06-20 15:54:44 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-06-29 18:31:47 +0000

    vfs_op_exit(): assert that mnt_vfs_ops stays non-zero for unmount or suspend
    
    Reviewed by:    mjg
    Tested by:      pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D35639
---
 sys/kern/vfs_mount.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 155e397b7f5e..73cc34da79ea 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1763,6 +1763,10 @@ vfs_op_exit_locked(struct mount *mp)
 	if (mp->mnt_vfs_ops <= 0)
 		panic("%s: invalid vfs_ops count %d for mp %p\n",
 		    __func__, mp->mnt_vfs_ops, mp);
+	KASSERT(mp->mnt_vfs_ops > 1 ||
+	    (mp->mnt_kern_flag & (MNTK_UNMOUNT | MNTK_SUSPEND)) == 0,
+	    ("%s: vfs_ops too low (%d) for mp %p in unmount or suspend",
+	    __func__, mp->mnt_vfs_ops, mp));
 	mp->mnt_vfs_ops--;
 }
 



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