From nobody Thu Oct 9 23:02:17 2025 X-Original-To: dev-commits-src-all@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 4cjQPQ0R9xz6CHJR; Thu, 09 Oct 2025 23:02:18 +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 4cjQPP74h6z3sgV; Thu, 09 Oct 2025 23:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760050938; 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=8PiZAGlxAOVu3MyokYsXLobt8jVWIg7DmhFxwDO93PU=; b=JcTUltiPshVu0RAWv8iHRY1qbiY9JkOTk7kuCIN9w0/0YgrZj/QZP5uRUemtreaw8XxNHX feJlJEs5AfQHqgvQrhLjnwdjq7aUl44a4rXn4xPmz69+jifvnADOdCectIWcVv4NzZTmUM l49WHUSBibvvHQLlju1wkwcza32bN1PpNGW2jL/+yqWRQUX8uSoVDpGh1Vwr2JCIKiD3vM r6UecGcu/33GAgsAhZYZ9VAug7eivd1qiXNp1uPGjgSq3DJzPbiIo9Tfvsjxt5zBIi+u7d pXD/hHL2aPwMj7O7cCtx7UDbhWeAjXnm8kch8vm8aAzEEBGFq/TxBq7hhxWeAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760050938; 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=8PiZAGlxAOVu3MyokYsXLobt8jVWIg7DmhFxwDO93PU=; b=vZIEfYOTzOLUhr/+2V4M640jMkUvzgoI8diXsacl7JsHX808pWXcYsWrVzsMuOyz49Crs+ bXZDneYg6p7Up/tZjF4Y6/h3af8LZYqghZvYoJF1r+GsRUZWnGQvyp7PEBmiX20Vmzibfq h5za4iUzvCOb9BGLBU7N4Nlnev9yDi4AsxlEtCMi3zq+Bq4RqxgHeHdQ8GNC1JSDYULCZM IM1DWjxH/fCdnDNNivzcAhXZ5Lu78HI5T2TLy+cg8MMQaXZsWhSIYsPXOnK0gTOZYULcad kVBv5zrJgZ3Fz4NzGzjUZ5Fl+RSR4czUc/y+hHrSQAjfgbX1g+SjU0khp2Lf0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760050938; a=rsa-sha256; cv=none; b=vFMfE8PLvbdreb63p8YXn8Xu2RHRGOIHg3BFdoQ50J9nJoyuCOWIWWgSeCZWzKvj6Ub9bn 5D6xKy3o92dp71Dm7C9oUcp9Daw+P+c6e4EaS1FwBl3l0VlgwH9fJCMHSE40Vnl11xROu0 1AIqQffZwmf/FFsu+NsCVBfbZAbtpWbRhY6LBJazhanAYAdYHIVYKilBLwiZGA8/Ic1EaR PczKGsDqu7EPVEYP+zQs83T0C7jADr08xWyX3ypF3YeWPeYXRs37jFl5qWj7F65a+BUukW elS128vss6ckCuN9uKqjuiHkgYWVrqsmeLS+deYcoxDTNwQGg0yvZEeaHLBDoA== 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 4cjQPP67tjzdZ6; Thu, 09 Oct 2025 23:02:17 +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 599N2HRm056258; Thu, 9 Oct 2025 23:02:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 599N2HTl056255; Thu, 9 Oct 2025 23:02:17 GMT (envelope-from git) Date: Thu, 9 Oct 2025 23:02:17 GMT Message-Id: <202510092302.599N2HTl056255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 419f2fe6b70b - main - nullfs: add a helper for testing if vnode belongs to a nullfs mount List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 419f2fe6b70b1a409bf7eca7020d7c745558690f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=419f2fe6b70b1a409bf7eca7020d7c745558690f commit 419f2fe6b70b1a409bf7eca7020d7c745558690f Author: Konstantin Belousov AuthorDate: 2025-10-08 15:42:27 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-09 22:47:05 +0000 nullfs: add a helper for testing if vnode belongs to a nullfs mount Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D52983 --- 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 0db50ef26bf9..17fd90203174 100644 --- a/sys/fs/nullfs/null.h +++ b/sys/fs/nullfs/null.h @@ -82,6 +82,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); +} extern uma_zone_t null_node_zone; 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 ec8a6b10b13f..4b9342f43870 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -278,7 +278,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 == NULL || - (*this_vp_p)->v_op != &null_vnodeops)) { + !null_is_nullfs_vnode(*this_vp_p))) { old_vps[i] = NULL; } else { old_vps[i] = *this_vp_p;