From nobody Wed Sep 20 03:45:31 2023 X-Original-To: bugs@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 4Rr4Dr0FGBz4tTJD for ; Wed, 20 Sep 2023 03:45:32 +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 4Rr4Dq6FRCz3Fql 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=vr4BGjIRJk3C+KwYe/X8yFlAMQgWY98PtF/keF3D+O7sa2W3d9ecmNEM2PSbTzMVBI2sWu hbJajDRVhOrJ7MAHJtYRNHB1FO8qgGkzsedpnjkDxtglz9uKo/nJe/frDdPpF8FpbWyo51 6+UFb3/3K9b7HQI4IwHLe1GF23v1u+0aFZQRxYUX7cmsCgYfcOnMSs+mMxPNvS/eFqnl// M/HLds8u73r984vBDOG5WVRCMlMX0AC+kGuChQJncBDtzWS7ZUFAh+1pgRoFM81hgePIja Cyk+9DuMPeqdn/onwR/R1SiXYILwWumiuflpvz6umDygKsfBN/G5Yy5iEbqCMw== 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=03nRQS5m4+kBfc8CGSquBi/OKQU9LI5szo7eTQyDJNE=; b=kwaWcNiKPs6uHqnz9/A5hf4FQcrQ9maPCK+8+SVmttTzNUapbrAhs+52B7zc4wspmLEjS+ 4dOT7NdppTGbxm/FwpCdp9dcXvaNeM+zIUXzTeHiks94i2jZwh/BzdVdAnuk5wsTK5mgsZ Mgr1x/1hFWSpffX5AEip9zg4K4mUCTxIZoS5+1MW9hySVTcjpFh6UfaWYt7uNR3RRcouzc bIK98nAXGZggVPneCPlvWniypBvofAC5Ry92J7wR3Mo482PLu1u8ewRlxZXxZn85s+VIFV 0jCu6UsYGBvh6Wu4ve0Sk4f5/zdEqaiOanv06XKBnneDEzdBm7TIOR9EWvUmgw== 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 4Rr4Dq5FvYzgC7 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 38K3jVvX026005 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 38K3jVVW026004 for bugs@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: bugs@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: AssignedTo 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@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 the assignee for the bug.=