From nobody Mon Oct 24 16:05:25 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 4Mx0KK2Z9jz4g48X; Mon, 24 Oct 2022 16:05:25 +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 4Mx0KK249xz3cwY; Mon, 24 Oct 2022 16:05:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666627525; 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=Ino46rbBfrngHsswgDfCYAM5mBekEz9jn/c92hGIrF0=; b=KXlDPlhWvat0BRQBAdk4ns1qqeUmLjZeuoj3ZXZNyBflLyys04mTgAqkrl7s7lgE84LnCb B0f05zrzbav+4FLYHmxp+C/5Y9Xb15jUraDpiduNmzrLXd2zAkxRscqTGRtkAuVVH4m6V3 iq2PJugOy88DyY0vwOEjtNVqaTf9dsCMVQhlVqmQZwAqz3eL4fiKk+YxjxjGtj1sX88eLF H0HC8kpY+lRgj7rNUcafQlssqtOC5i2KlXKe21n5FsDVi08vrrWox1xEEJ6/pX4ALUyent xsIHl4Q8FT8nJfE0KIm7Pn/uJXxRkaSQ28LuwOmQFdFMX45KZL3v7dgI73xisQ== 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 4Mx0KK17CfzHfD; Mon, 24 Oct 2022 16:05:25 +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 29OG5P0X027195; Mon, 24 Oct 2022 16:05:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29OG5PhH027194; Mon, 24 Oct 2022 16:05:25 GMT (envelope-from git) Date: Mon, 24 Oct 2022 16:05:25 GMT Message-Id: <202210241605.29OG5PhH027194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6fe0a6c80a1a - main - 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/main X-Git-Reftype: branch X-Git-Commit: 6fe0a6c80a1aff14236924eb33e4013aa8c14f91 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666627525; 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=Ino46rbBfrngHsswgDfCYAM5mBekEz9jn/c92hGIrF0=; b=sOHHVInYErQZfZSnq61F9zyuKfpErkI5/E7hDst0HeQ5Xn1uHFWIZDgMzfL0e4MjieHP6t CbVNflmrBPsINIlbiTfg9QxZb2B0Txo9UGmBfwjH+EHi9mOAWbE7ZlnBMVWg39G/PBsbt4 Z/jukWhJRPeADzw3AuMsEb4Q8H5HnLuv+5AzjqPG6UYZ9v68TDCG2wkbEnnnLEo016ChBM rHQmbMOQjVSA/QUAyvsgD9HB6cfcFY9nT3fxW9nzhAwLCTMapWfeW9T+ok+A+g2UYnswis KO9SGwAXNY1cEb9POuHBV7RM8AYsfLq+JswWMammLa4dPF1mszBcRHLXXrfMpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666627525; a=rsa-sha256; cv=none; b=mIGrYTfO6X7D/orcaLd0W1weRF0qb7CT0X50fQB5XvtCY7ekIpkJuQypuaqueGPJweS474 wmA4398lsbwkajN9Lhpr1Y9m3EDaVWOhByJpeRH59ZcM8lLbt6mmAgP3EezItyI3nOsmk+ omM3Ng7A3QUpaGNvAf5DZJ8fbI4iJyl9DWNIpjN4/oIut6DqMa753mXFsCd2/khFHFZrW6 7Xgyus2cbpiicbiCRwcR+iLVgN2qm4FdBNUHetVFUkeCa5B0Rq0sZVBKgwjsaaGEx9xisP 1C9uQvITFvnhwmS1aWfKRJpyJUM0/LBrlBw9CFRNgxgEKNKgvsGP9ObNboWHgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6fe0a6c80a1aff14236924eb33e4013aa8c14f91 commit 6fe0a6c80a1aff14236924eb33e4013aa8c14f91 Author: Mark Johnston AuthorDate: 2022-10-24 15:55:48 +0000 Commit: Mark Johnston CommitDate: 2022-10-24 16:05:17 +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 MFC after: 3 days --- 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 c65be4c134d5..4cb7f63b5230 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -1818,7 +1818,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));