From nobody Tue Dec 05 18:27:40 2023 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 4Sl8Cd1Yxgz53JRq; Tue, 5 Dec 2023 18:27:41 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sl8Cd0g7gz3ZMw; Tue, 5 Dec 2023 18:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701800861; 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=C0KXcY9jN6DK2AluvOvC7kNxjxlCUnOztF/AXFEODyU=; b=O9HivpOHaiEFGaQ0Jp6cvyJf/EI60XWig9c48EX8wtMawX2pQGBy7Hkf6Ky9mGkzbbgYwg zdzEMcdiLIXZMhJaEqbzRTdbB6OvDsHRnM8rFiSasl27+J3tl2TsNU3w0G01ibSj4O39XL v/a7sz0m4WaTpWussNB2xz11IaiGm4ok9asqOJdhjGTt7r8dxXAsQaHdR3cejQXrDdPpYY DKJfVw8qHfmTf9O28cbv/M2SrUGvDJHx/Y1RTH1dICegQ1hEKNOYLY//4286bDJnbr1kzp dOaz2zsdIvTAeirURYEKe00AL0YdnBTInZs+X90g2ROZ6X6yBsxmpWW81TF2kA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701800861; a=rsa-sha256; cv=none; b=uyufS8CM5q2K872o6wg37AehCmRkAfZYGs3tGvAHOoKcKh95Nwug+1PxydJ39QEwxAvA+i oj3klLqmFQVPV7WAqBBOS7KHI4xfh95BpUrWRRlMcfivCyzm1cvmlVWGVpgK4QsBmVC5jN R8dQMrUVpVTCChgNJK56n8SyWk4qThqp+ePOoFbBl9yKLG2n2RLs09/TEx4Xz772TNQ2Ui CtBEAH5Z9P5xs8hrEgCBp/eEKkmAhZuq8RggR4FsUlfCylIpKKJ02cVG9NteWo4R2+gmo5 XR2wiQki3+JFEhQWHu6ahfmPTly+UAc7OOLkUwbviGfkpIZJca8wzHt9V+0GsA== 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=1701800861; 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=C0KXcY9jN6DK2AluvOvC7kNxjxlCUnOztF/AXFEODyU=; b=Pw8GL9FxHD8fGC+9jeubEqbJed6CvJJQoY+3erjSKQVf8/W2QLY6SWgkZ/3qhaVtj7Tf2w 02FTve7smr6A+cb046DmrHc4qxKQoLy5Wl/xfanmABSleVAwDQlMdNBHwI13ZDV2Uh/ikl /B/AlUrrrwstNAJmerPGNLRXxTY/BiGKPaV7zmRcsqSVVlmrcJ46fKmeH3Kl5pjNBwv2/H iNSN+wdoWXamOSZJ6JM11ay0dBL/wIt2DAReZfpygvmyJEIi5FQ/J1lQ2gbosNYN9iCf4I gheCd99YCZ9x/p8PrPl4+cEwKfaW08+XQQX2JV3QW1ldDKZ33ehhJxTrT0zG6Q== 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 4Sl8Cc6h45z5B1; Tue, 5 Dec 2023 18:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3B5IResQ009544; Tue, 5 Dec 2023 18:27:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3B5IReBI009541; Tue, 5 Dec 2023 18:27:40 GMT (envelope-from git) Date: Tue, 5 Dec 2023 18:27:40 GMT Message-Id: <202312051827.3B5IReBI009541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 889ecd8fd178 - releng/14.0 - zfs: cherry-pick commit from master 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 889ecd8fd178c4779e10e208f4845c9bb7f4d616 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=889ecd8fd178c4779e10e208f4845c9bb7f4d616 commit 889ecd8fd178c4779e10e208f4845c9bb7f4d616 Author: rmacklem <64620010+rmacklem@users.noreply.github.com> AuthorDate: 2023-11-28 00:31:03 +0000 Commit: Mark Johnston CommitDate: 2023-12-04 15:45:56 +0000 zfs: cherry-pick commit from master #15563 522414da3b FreeBSD: Fix ZFS so that snapshots under .zfs/snapshot are NFS visible Obtained from: OpenZFS Approved by: so Security: FreeBSD-EN-23:22.vfs --- sys/contrib/openzfs/include/os/freebsd/spl/sys/vfs.h | 2 +- sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c | 9 ++++++++- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/vfs.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/vfs.h index 7f163fcfdb1e..f2196da56bc8 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/vfs.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/vfs.h @@ -101,7 +101,7 @@ void vfs_setmntopt(vfs_t *vfsp, const char *name, const char *arg, void vfs_clearmntopt(vfs_t *vfsp, const char *name); int vfs_optionisset(const vfs_t *vfsp, const char *opt, char **argp); int mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, - char *fspath, char *fspec, int fsflags); + char *fspath, char *fspec, int fsflags, vfs_t *parent_vfsp); typedef uint64_t vfs_feature_t; diff --git a/sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c b/sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c index a07098afc5b4..3f33547216eb 100644 --- a/sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c +++ b/sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c @@ -120,7 +120,7 @@ vfs_optionisset(const vfs_t *vfsp, const char *opt, char **argp) int mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath, - char *fspec, int fsflags) + char *fspec, int fsflags, vfs_t *parent_vfsp) { struct vfsconf *vfsp; struct mount *mp; @@ -220,6 +220,13 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath, mp->mnt_opt = mp->mnt_optnew; (void) VFS_STATFS(mp, &mp->mnt_stat); +#ifdef VFS_SUPPORTS_EXJAIL_CLONE + /* + * Clone the mnt_exjail credentials of the parent, as required. + */ + vfs_exjail_clone(parent_vfsp, mp); +#endif + /* * Prevent external consumers of mount options from reading * mnt_optnew. diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c index 420d887b661e..79909415178a 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c @@ -1026,7 +1026,8 @@ zfsctl_snapdir_lookup(struct vop_lookup_args *ap) "%s/" ZFS_CTLDIR_NAME "/snapshot/%s", dvp->v_vfsp->mnt_stat.f_mntonname, name); - err = mount_snapshot(curthread, vpp, "zfs", mountpoint, fullname, 0); + err = mount_snapshot(curthread, vpp, "zfs", mountpoint, fullname, 0, + dvp->v_vfsp); kmem_free(mountpoint, mountpoint_len); if (err == 0) { /*