From nobody Thu Oct 16 02:22:28 2025 X-Original-To: dev-commits-src-branches@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 4cnBYd0q8Cz6CFxm; Thu, 16 Oct 2025 02:22:29 +0000 (UTC) (envelope-from git@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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cnBYd0DYZz3t3m; Thu, 16 Oct 2025 02:22:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760581349; 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; bh=aGGlaBbpzDtCldiz1pK8AJgFRPnuqmHkgdJkOILNQjg=; b=t6wbDgMta720GEZf0bDZ0iY/H1XXZ6Fy1EtE+1Xe0oTcdk9q0p57bSnYEecxzvmAYjpafC Y9Lt808kwOJyXhymCHCQn5FWnG0lNdHWVuRNT7OabJIuxHZNwpAQFbcaG4I8gR02uWdhnT pCCtLu6HEoQhdDZTgOx/7ObCb7AAJSJO/M8qtWxB/nnFetc5jLn4RHqNV9g3/yZd4sjf6V +WZh8EfHfDl+YeK/k/s7BscreNBxcDsBzezjYeQ9sk55XwtHYWK32FnoMLSY/yzXMyp9b8 acIkGydpUxZ25YAM89SJFwrfzfxb6ZWDgl5M+w0ZigrX53qsN1BhVOF3NiZaKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760581349; 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; bh=aGGlaBbpzDtCldiz1pK8AJgFRPnuqmHkgdJkOILNQjg=; b=hpwV9Zz+18F78l9ECnRj6YjoKTZUn9iq1tfEUo+3U9zmM+uzLaGbblz7XB73XLSKR/4Xeh 6C5uv9sCpYk+Bx59N/aunm2psquJ6q5J6ZQQFredG4H7Q5eoA4Lcs3LBuJMMk06JtMzcE+ aIV0RzAuEVI3TBalTqGdZkYJMUSf04ceDfKt0YliVgm7b0tDk8/kYLxiWIrGZV8/Wb0GX0 6j+XWXj7KQAoOSLs2DPm/BxEIZthh7CuZMBltptRfqjVDS9QWz4WdWwwjlOvN+vO29Gapu bKcz6y3SCeAXdyeri1iBwC9wJwuLgJ/afx2tReHY80CRMtDkCAoo31L1iGazCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760581349; a=rsa-sha256; cv=none; b=M3I96LjXQFID66JZOII5pDUjdOJfZQXDVX4i2zwSE51IuiQP1aT1XahkoElRiY/ahp5V3g tnviefjlu61ClH7EOl0tpOBZjZJeRb8FAsFOBy7oy7ECEA891OweYWmO4J0F2tNVRG8xSH GJ8oFgfPZNvvgzdlZSZRFe6zvOntp9s0PnEUfqzWT7vwayv/BdSSdh1973Rjo982iTr2kf B9Wlp5eiy2qY5lXKJUlN+SexOfdFA1NZkTgLRSsUXeiVT30bm+d46otxcG1uLGeitf1a5B JzCV3dXqjWFgk/0LXd7Ru9DL/VwOGM0KRyHzptG04hy7twLc/SFLj7hBSDsG0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4cnBYc6y4Jz14HF; Thu, 16 Oct 2025 02:22:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59G2MSx2017880; Thu, 16 Oct 2025 02:22:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59G2MSNr017877; Thu, 16 Oct 2025 02:22:28 GMT (envelope-from git) Date: Thu, 16 Oct 2025 02:22:28 GMT Message-Id: <202510160222.59G2MSNr017877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 5a0a2d269f37 - stable/15 - nullfs: add a helper for testing if vnode belongs to a nullfs mount List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 5a0a2d269f37fa79ee879e54856c94272b7e3c33 Auto-Submitted: auto-generated The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5a0a2d269f37fa79ee879e54856c94272b7e3c33 commit 5a0a2d269f37fa79ee879e54856c94272b7e3c33 Author: Konstantin Belousov AuthorDate: 2025-10-08 15:42:27 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-16 02:22:20 +0000 nullfs: add a helper for testing if vnode belongs to a nullfs mount (cherry picked from commit 419f2fe6b70b1a409bf7eca7020d7c745558690f) --- sys/fs/nullfs/null.h | 10 ++++++++++ sys/fs/nullfs/null_vfsops.c | 4 ++-- sys/fs/nullfs/null_vnops.c | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/fs/nullfs/null.h b/sys/fs/nullfs/null.h index 0a93878c859f..abd652c4ac1c 100644 --- a/sys/fs/nullfs/null.h +++ b/sys/fs/nullfs/null.h @@ -78,6 +78,16 @@ struct vnode *null_checkvp(struct vnode *vp, char *fil, int lno); #endif extern struct vop_vector null_vnodeops; +extern struct vop_vector null_vnodeops_no_unp_bypass; + +static inline bool +null_is_nullfs_vnode(struct vnode *vp) +{ + const struct vop_vector *op; + + op = vp->v_op; + return (op == &null_vnodeops); +} #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_NULLFSNODE); diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 4cddf24a5745..e2dabd8e33cc 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -116,7 +116,7 @@ nullfs_mount(struct mount *mp) /* * Unlock lower node to avoid possible deadlock. */ - if (mp->mnt_vnodecovered->v_op == &null_vnodeops && + if (null_is_nullfs_vnode(mp->mnt_vnodecovered) && VOP_ISLOCKED(mp->mnt_vnodecovered) == LK_EXCLUSIVE) { VOP_UNLOCK(mp->mnt_vnodecovered); isvnunlocked = true; @@ -150,7 +150,7 @@ nullfs_mount(struct mount *mp) /* * Check multi null mount to avoid `lock against myself' panic. */ - if (mp->mnt_vnodecovered->v_op == &null_vnodeops) { + if (null_is_nullfs_vnode(mp->mnt_vnodecovered)) { nn = VTONULL(mp->mnt_vnodecovered); if (nn == NULL || lowerrootvp == nn->null_lowervp) { NULLFSDEBUG("nullfs_mount: multi null mount?\n"); diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 74c1a8f3acb6..ebb765b0a1c5 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -274,7 +274,7 @@ null_bypass(struct vop_generic_args *ap) * that aren't. (We must always map first vp or vclean fails.) */ if (i != 0 && (*this_vp_p == NULLVP || - (*this_vp_p)->v_op != &null_vnodeops)) { + !null_is_nullfs_vnode(*this_vp_p))) { old_vps[i] = NULLVP; } else { old_vps[i] = *this_vp_p;