From nobody Fri Oct 24 09:51:53 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 4ctJ8T6891z6Dycx; Fri, 24 Oct 2025 09:51:53 +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 4ctJ8T32P7z3bLZ; Fri, 24 Oct 2025 09:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761299513; 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=v58GnfVlS/fgNiomlS9wx/cFNwnUzI/0h/63NH2J1OQ=; b=GV6/8eQrfJYHjMB1BxRRaCuWNfZckClf7W5CkcFGShKt5V79gNH5gEU3FDTeJNYfgnYQou 25J4lwLSBerapPYfH3uzdGDlJwVDxKNlkSNuUKmWr8UUVBtaFOOqgR7qa/FUCHvUEFpnjH HCCDVXb00Bx3l9xTMzF4rkn8WRxMFKhXZWrSF6uLDf7Rg0ao7eKFMvGbBXUamIWm1ToS8r 2ia7Y510EaQtfisuabC/g77ue4rP9eb7f1jfdqrVcEWJNbybGWfgPLf5hQShM83b513+3H uOljkHkGkEI6qj49CXKCRBdN68s5Cai2ymK5VJPtUNAo/6YLlHeZsYbmp6dy2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761299513; 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=v58GnfVlS/fgNiomlS9wx/cFNwnUzI/0h/63NH2J1OQ=; b=yCeNEEAKZo6zaaJ9Sz+HOFwfymIEkQX6223pqemLo9NkYXxOZp2gLQ3B5Y4rTAQ+8ajMoK mN8DxPLrvG5W3PmeCPsLNWzPAr/wYCaAvOvQ14zwnybpzVEM4/fMBwppabsQnLwPHA0fq2 6nIGGQ9e2r4zl886HThPmetO11IbdL/VxrZs8Cora3PQl1wKjGqgl8TBa5gRw7JXQiB4bX 8H1i/A7o9J9v9ZoMGNV3fsKsuhRAJaq+TCBwJ5WT2CVx+3zAOxHhuvycT8D6CLz0g0/zzB mp0xiXC/UGCluS2Imu9CzHRjbr78j0WGLYNESEeNGoIUnewjRujaWjCG/lSBTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761299513; a=rsa-sha256; cv=none; b=YQyXXh/+RHOa5Rfros4k+ntyBmDkLxlD2e3j3mr/T+XtNwLB9N2IMwGTM84CD+Aa7+VqgC wjDCczvomw5lB2AV+y+6JYzEE/iSNP8P3ELFhASMs/DfWacXtyknlfHkdivCCucJv7Voge tWU+ILg9P7In3h3zgk7SWCwFpeS8wUYhom7EPpjlS5P7l0viclspA+HC7Ntj0hG2hJCC/h IpBZnz409mkAkJdFoR9/qiDpdVSrkDTpv1hM3uqHYXvrZ4ENRmj1o2E9NtVAE7Fi4ya0CZ mLJhDQqsMAAmbJeYnkJxU/N6oKyZ1WcQ6vWxlQGIfiFm3GflocA6PgLbjx9laQ== 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 4ctJ8T2cwjzwPG; Fri, 24 Oct 2025 09:51:53 +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 59O9prVn088747; Fri, 24 Oct 2025 09:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59O9praQ088744; Fri, 24 Oct 2025 09:51:53 GMT (envelope-from git) Date: Fri, 24 Oct 2025 09:51:53 GMT Message-Id: <202510240951.59O9praQ088744@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: 1c8f3ba03ccc - stable/14 - nullfs: add nounixbypass mount option 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/14 X-Git-Reftype: branch X-Git-Commit: 1c8f3ba03cccf6e14d38c2a479b889c29d0eb6bf Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1c8f3ba03cccf6e14d38c2a479b889c29d0eb6bf commit 1c8f3ba03cccf6e14d38c2a479b889c29d0eb6bf Author: Konstantin Belousov AuthorDate: 2025-10-08 15:47:15 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-24 09:47:37 +0000 nullfs: add nounixbypass mount option (cherry picked from commit 6fa205a6233fea7c41ba0306c778bc5cab37ce7d) --- sys/fs/nullfs/null.h | 5 +++-- sys/fs/nullfs/null_subr.c | 4 +++- sys/fs/nullfs/null_vfsops.c | 9 +++++++++ sys/fs/nullfs/null_vnops.c | 8 ++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/sys/fs/nullfs/null.h b/sys/fs/nullfs/null.h index 34b8b4225ba8..eebf6da571b8 100644 --- a/sys/fs/nullfs/null.h +++ b/sys/fs/nullfs/null.h @@ -37,7 +37,8 @@ #ifndef FS_NULL_H #define FS_NULL_H -#define NULLM_CACHE 0x0001 +#define NULLM_CACHE 0x0001 +#define NULLM_NOUNPBYPASS 0x0002 struct null_mount { struct mount *nullm_vfs; @@ -88,7 +89,7 @@ null_is_nullfs_vnode(struct vnode *vp) const struct vop_vector *op; op = vp->v_op; - return (op == &null_vnodeops); + return (op == &null_vnodeops || op == &null_vnodeops_no_unp_bypass); } #ifdef MALLOC_DECLARE diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c index 546f0aea3766..b0e3d15b4789 100644 --- a/sys/fs/nullfs/null_subr.c +++ b/sys/fs/nullfs/null_subr.c @@ -212,7 +212,9 @@ null_nodeget(struct mount *mp, struct vnode *lowervp, struct vnode **vpp) */ xp = malloc(sizeof(struct null_node), M_NULLFSNODE, M_WAITOK); - error = getnewvnode("nullfs", mp, &null_vnodeops, &vp); + error = getnewvnode("nullfs", mp, (MOUNTTONULLMOUNT(mp)->nullm_flags & + NULLM_NOUNPBYPASS) != 0 ? &null_vnodeops_no_unp_bypass : + &null_vnodeops, &vp); if (error) { vput(lowervp); free(xp, M_NULLFSNODE); diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 7f4cc5e38f96..8b9e04775449 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -91,6 +91,8 @@ nullfs_mount(struct mount *mp) bool isvnunlocked; static const char cache_opt_name[] = "cache"; static const char nocache_opt_name[] = "nocache"; + static const char unixbypass_opt_name[] = "unixbypass"; + static const char nounixbypass_opt_name[] = "nounixbypass"; NULLFSDEBUG("nullfs_mount(mp = %p)\n", (void *)mp); @@ -226,6 +228,13 @@ nullfs_mount(struct mount *mp) &xmp->notify_node); } + if (vfs_getopt(mp->mnt_optnew, unixbypass_opt_name, NULL, NULL) == 0) { + ; + } else if (vfs_getopt(mp->mnt_optnew, nounixbypass_opt_name, NULL, + NULL) == 0) { + xmp->nullm_flags |= NULLM_NOUNPBYPASS; + } + if (lowerrootvp == mp->mnt_vnodecovered) { vn_lock(lowerrootvp, LK_EXCLUSIVE | LK_RETRY | LK_CANRECURSE); lowerrootvp->v_vflag |= VV_CROSSLOCK; diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index e398053c7028..2e34b77a5a7e 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -1192,3 +1192,11 @@ struct vop_vector null_vnodeops = { .vop_copy_file_range = VOP_PANIC, }; VFS_VOP_VECTOR_REGISTER(null_vnodeops); + +struct vop_vector null_vnodeops_no_unp_bypass = { + .vop_default = &null_vnodeops, + .vop_unp_bind = vop_stdunp_bind, + .vop_unp_connect = vop_stdunp_connect, + .vop_unp_detach = vop_stdunp_detach, +}; +VFS_VOP_VECTOR_REGISTER(null_vnodeops_no_unp_bypass);