From nobody Thu Oct 27 12:00:19 2022 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 4Mykl74Fscz4h4Hs; Thu, 27 Oct 2022 12:00:19 +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 4Mykl73kpjz456B; Thu, 27 Oct 2022 12:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666872019; 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=zU/6DvUBDqWz/kdw6M8cq+0wJBcSha6yGtMPtN22K+0=; b=m81SqVCCo9r3ue7ivfelXYIXrPMySayzIni2i/VKNOCEEUmmjAoBy9cYrSNCk1f1J+qkdz z0vY72xd0DP0Ke/+EH/tXX4Nk1rfrnyQjEHcm2/QlX8rxM1lvdw8+HJWZperAs5jVIyueH f6BfXijHpZk5y9VPdatw8TXM64S7V7esbF0Qc+nLqPshYcRGqoPUX07wFXep0CpmVM0VCT 3UQ7TkovKfv+f1StUMjOsfWbiPcREh4Aeq02FJ6eMc1nRYMDWdRIq17VnWDat1tCE1H7gg TwSAkik1T/YND30DHUOTxOvtBK9dp4odHQ/X/kpErCl5CPOy9XyipeVqd/Xm4w== 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 4Mykl72lC8zwZ0; Thu, 27 Oct 2022 12:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29RC0Jkl015896; Thu, 27 Oct 2022 12:00:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29RC0JQv015888; Thu, 27 Oct 2022 12:00:19 GMT (envelope-from git) Date: Thu, 27 Oct 2022 12:00:19 GMT Message-Id: <202210271200.29RC0JQv015888@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: 562c9ac58c76 - stable/13 - zfs: Fix a pair of bugs in zfs_fhtovp() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 562c9ac58c7678b13f52b0bfe63148e40d7bf63d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666872019; 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=zU/6DvUBDqWz/kdw6M8cq+0wJBcSha6yGtMPtN22K+0=; b=DrbPXbOiFc8z2L9ThfsWA3ukIRrgRsDWehfcO+ZoIemY02hQDqOCIflgl4LquBRYjc1wRR 7QSBJeTvBbRnQKm4GvhEmZfkLY+Z+MXyU2yne7cVycY14QZqxrnDg+X377sIrH9JQjXqQu beevwMKfrff762tYQkFPK2QJw1Zz72O7m99fLQPFhJVOyN+QqU4LXXqvFTo9xkh6+MCeW0 BScn0yC1yzCTWKOmHq11226HG2ttQR2ix32GrGBR+LxCWMr7Va/A+58/mANx50J8tFRYNu tZQ7JIYwUNRB5B26kfZKTkB6rWLhP6bHIEBIUyXp509NOL5ssc1y2ph0EHQC3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666872019; a=rsa-sha256; cv=none; b=J3CX2DIwCxG26lctOmkDvfvm/oPnCsWLAq2X+521tF9up/CZ0wZvAmqObdkvBZgxEEblHC +9FhW0GFYDlT0nYakZZJUMAtddLNBCUjVJ3VcOWJdnDnGeTKIlNB7e4Jw9Ogsvwc9wnvUf MAl1PLlnbYk7I/0fZHiue5SEgwgVmd2NXPQS0FFqu01auXX6PF/ZwjVLu2utDIrQxodiu2 P3RkoUoUIXYvkXbMXITU1VVk/KGg0YM0wjXZSxpvpeudpziI8X8vzYH3teYlok3QE0Svew bxLTCAPP7rGBk6CQvmpMgjVJSOmEKCjEFl2YG+FzjN7GpsH/YewBGU5FghuGaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=562c9ac58c7678b13f52b0bfe63148e40d7bf63d commit 562c9ac58c7678b13f52b0bfe63148e40d7bf63d Author: Mark Johnston AuthorDate: 2022-10-24 15:55:48 +0000 Commit: Mark Johnston CommitDate: 2022-10-27 12:00:01 +0000 zfs: Fix a pair of bugs in zfs_fhtovp() This cherry-picks upstream ed566bf1cd0bdbf85e8c63c1c119e3d2ef5db1f6 - Add a zfs_exit() call in an error path, otherwise a lock is leaked. - Remove the fid_gen > 1 check. That appears to be Linux-specific: zfsctl_snapdir_fid() sets fid_gen to 0 or 1 depending on whether the snapshot directory is mounted. On FreeBSD it fails, making snapshot dirs inaccessible via NFS. PR: 266236 (cherry picked from commit 6fe0a6c80a1aff14236924eb33e4013aa8c14f91) --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c index cdd762dcbcbf..928cd83dfea0 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -1845,7 +1845,8 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp) return (SET_ERROR(EINVAL)); } - if (fidp->fid_len == LONG_FID_LEN && (fid_gen > 1 || setgen != 0)) { + if (fidp->fid_len == LONG_FID_LEN && setgen != 0) { + zfs_exit(zfsvfs, FTAG); dprintf("snapdir fid: fid_gen (%llu) and setgen (%llu)\n", (u_longlong_t)fid_gen, (u_longlong_t)setgen); return (SET_ERROR(EINVAL));