The branch stable/13 has been updated by kib:

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

commit 96251798e0100e46990d90e25917fb1dac6acce6
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2022-06-20 15:54:44 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2022-07-06 12:33:30 +0000

    vfs_op_exit(): assert that mnt_vfs_ops stays non-zero for unmount or suspend
    
    (cherry picked from commit 1e54362824f62a9d43585e94422d1d3d5f0268f9)
---
 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 fa567361ae85..e14b1e882501 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1605,6 +1605,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--;
 }
 

Reply via email to