From nobody Wed Sep 20 03:45:31 2023 X-Original-To: fs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rr4Dq6H5Xz4tTFW for ; Wed, 20 Sep 2023 03:45:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rr4Dq3n26z3Fsm for ; Wed, 20 Sep 2023 03:45:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695181531; a=rsa-sha256; cv=none; b=xnCB2zz05Y2jYSsCuK+Amcn1p8JUToBIdWmI0qOnGsQHkEuX8b4kbjhLMmrhvyQBCwL0Sa GAFegzcdjYnzhFEEKKPR5vnep5U7Y6QTMy5O5iyzIePBwQ7jn9k0YKYwVUe7/zHtxx/+MP D9NZKUZtB00wMcUB55jYM+wT1mnRhsx7SMHMiLce42OaxOMBN6w6oRzQro2h/m2SBclv1J OUktZiYHNJsrpmo8r1HJPBxe24Xsqt9CFDqr3kKptYuGxCGNJtnb7cIK4lXWrbWF6Lw7BU UEkw6d2JED5S4hZXN9FUeEvY0TPoAqDAXyneDmJ0l7ZEaB1SUZbYOKEYdBmfGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695181531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QD0BXs1yjGPzpZn92+/L2rc5hNDE+za1NGHX7enGuZo=; b=TsGPNU6v+7Cmfb0mUlOu1NkUlpWsfdHoQWaPRvzmbgGxNCTmd8RBNV6ebf9rloUayVaKMm YGH1rPmMj4u8XjNdtu7tiEyUhthdWIVEXLqn+TTCJbFismDRZ0EeakDGzNLiss6qxXV/ex ME8ApWPGEnWDsABhXWGZpg+nRn8KAZZrYOkywPXAHSaNyaYwNjpnqCWmOPYXOmnLXb74su iIyBOqD8e3n6+R69mAN9cpsGWjdMYBHGvzpFEqzE1gENxRycG+h5jDilrdr12j8x3Mjsr3 9ljR/N6WRmRlwGM2OHVt5UIzSsR1i6zJ5zoE+UK7AQt/tfhUzflAQcb870zA3w== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rr4Dq2kZXzgNn for ; Wed, 20 Sep 2023 03:45:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 38K3jVhr025989 for ; Wed, 20 Sep 2023 03:45:31 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 38K3jVqu025988 for fs@FreeBSD.org; Wed, 20 Sep 2023 03:45:31 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: fs@FreeBSD.org Subject: [Bug 273953] panic: vfs_remount_ro: mp is not busied Date: Wed, 20 Sep 2023 03:45:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: crash X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: kib@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273953 --- Comment #1 from Konstantin Belousov --- This is cosmetic issue. mnt_lockref should be asserted only after vfs_op_enter(). Patch below should be enough. commit 5a85fa192ec81998b723361028da21c5bcb4e66f Author: Konstantin Belousov Date: Wed Sep 20 06:42:31 2023 +0300 vfs_remount_ro(): mnt_lockref should be only accessed after vfs_op_ente= r() 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) =3D=3D 0, @@ -3012,17 +3013,19 @@ vfs_remount_ro(struct mount *mp) rootvp =3D NULL; vp_covered =3D mp->mnt_vnodecovered; error =3D vget(vp_covered, LK_EXCLUSIVE | LK_NOWAIT); - if (error !=3D 0) + if (error !=3D 0) { + vfs_op_exit(mp); return (error); + } VI_LOCK(vp_covered); if ((vp_covered->v_iflag & VI_MOUNT) !=3D 0) { VI_UNLOCK(vp_covered); vput(vp_covered); + vfs_op_exit(mp); return (EBUSY); } vp_covered->v_iflag |=3D VI_MOUNT; VI_UNLOCK(vp_covered); - vfs_op_enter(mp); vn_seqc_write_begin(vp_covered); MNT_ILOCK(mp); --=20 You are receiving this mail because: You are on the CC list for the bug.=