Summary: | panic: vfs_remount_ro: mp is not busied | ||
---|---|---|---|
Product: | Base System | Reporter: | Gleb Smirnoff <glebius> |
Component: | kern | Assignee: | Konstantin Belousov <kib> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | fs, kib, markj, mjg |
Priority: | --- | Keywords: | crash |
Version: | 15.0-CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Gleb Smirnoff
2023-09-20 01:22:28 UTC
This is cosmetic issue. mnt_lockref should be asserted only after vfs_op_enter(). Patch below should be enough. commit 5a85fa192ec81998b723361028da21c5bcb4e66f Author: Konstantin Belousov <kib@FreeBSD.org> Date: Wed Sep 20 06:42:31 2023 +0300 vfs_remount_ro(): mnt_lockref should be only accessed after vfs_op_enter() PR: 273953 diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 45ab9cfc93cc..8364081585f8 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -3004,6 +3004,7 @@ vfs_remount_ro(struct mount *mp) struct vnode *vp_covered, *rootvp; int error; + vfs_op_enter(mp); KASSERT(mp->mnt_lockref > 0, ("vfs_remount_ro: mp %p is not busied", mp)); KASSERT((mp->mnt_kern_flag & MNTK_UNMOUNT) == 0, @@ -3012,17 +3013,19 @@ vfs_remount_ro(struct mount *mp) rootvp = NULL; vp_covered = mp->mnt_vnodecovered; error = vget(vp_covered, LK_EXCLUSIVE | LK_NOWAIT); - if (error != 0) + if (error != 0) { + vfs_op_exit(mp); return (error); + } VI_LOCK(vp_covered); if ((vp_covered->v_iflag & VI_MOUNT) != 0) { VI_UNLOCK(vp_covered); vput(vp_covered); + vfs_op_exit(mp); return (EBUSY); } vp_covered->v_iflag |= VI_MOUNT; VI_UNLOCK(vp_covered); - vfs_op_enter(mp); vn_seqc_write_begin(vp_covered); MNT_ILOCK(mp); Thanks, Konstantin! I can't test it since don't have reproducer. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=c584bb9cac16bc200ac45cc8b709e7e7e99e24bb commit c584bb9cac16bc200ac45cc8b709e7e7e99e24bb Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2023-09-20 03:42:31 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2023-09-21 00:59:11 +0000 vfs_remount_ro(): mnt_lockref should be only accessed after vfs_op_enter() PR: 273953 Sponsored by: The FreeBSD Foundation MFC after: 1 week sys/kern/vfs_mount.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5b200ff58126a028ba357f297cbb596a7475962c commit 5b200ff58126a028ba357f297cbb596a7475962c Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2023-09-20 03:42:31 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2023-09-28 09:05:05 +0000 vfs_remount_ro(): mnt_lockref should be only accessed after vfs_op_enter() PR: 273953 (cherry picked from commit c584bb9cac16bc200ac45cc8b709e7e7e99e24bb) sys/kern/vfs_mount.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=40cec659c167d1773826cf44f5ef6394cb0ad8fd commit 40cec659c167d1773826cf44f5ef6394cb0ad8fd Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2023-09-20 03:42:31 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2023-09-28 09:06:23 +0000 vfs_remount_ro(): mnt_lockref should be only accessed after vfs_op_enter() PR: 273953 (cherry picked from commit c584bb9cac16bc200ac45cc8b709e7e7e99e24bb) sys/kern/vfs_mount.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) I'll presume that the bug is fixed now. |