From nobody Tue Nov 1 20:33:38 2022 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 4N21v66Wl3z4hCrR; Tue, 1 Nov 2022 20:33:38 +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 4N21v660NJz3Dv2; Tue, 1 Nov 2022 20:33:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667334818; 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=X5Varv8r+R8CeumxP8ilnxX8KkN/8rc/JesPqQqyoeI=; b=h2qjf75t2g8w+RWRV7PB/YY/0z+aHdPEDKy/2EZ+4SpS8lPfB9GKy73bb5/78nK1GnUD+5 XENzauZarb3z77q6/UDxHuKQfVNMzmH7uKecBOA4XzNhl5mCBB7n7WdzLUiNe+GsOlwWGm HsOBqDSp5Idsd+FcbuL6oOTNkI1eLx+b8U17voYp1LAlV65TJsyza7YcK6mxTxLkZHSi3c /Ua4S/riAjJtwa6YOLblLaF2c7f1p6hmyTKsYGFBobdUYd6DWPqK2my5TKCU+QaRhA9txi Eq4ctsOb6DY7HcpWBrNZ209MjZKGNVuWsYbTfj81v4BSNVvON/ONKoYtNLjV8g== 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 4N21v652PDzVgl; Tue, 1 Nov 2022 20:33:38 +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 2A1KXcoC026206; Tue, 1 Nov 2022 20:33:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A1KXcot026205; Tue, 1 Nov 2022 20:33:38 GMT (envelope-from git) Date: Tue, 1 Nov 2022 20:33:38 GMT Message-Id: <202211012033.2A1KXcot026205@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: 7ab877cb3f9d - releng/13.1 - zfs: Fix a pair of bugs in zfs_fhtovp() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13.1 X-Git-Reftype: branch X-Git-Commit: 7ab877cb3f9d55a394e43a2c1a1e2711df12226d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667334818; 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=X5Varv8r+R8CeumxP8ilnxX8KkN/8rc/JesPqQqyoeI=; b=U4q9K88L3DFaNlOFeZzmr9Vd4uJ1Jm2FPqRP7IlcycZfb0AXtZFlp94H1w7pX1iJ8EAj2F iEwlJHx2uFWbpf0RdX057yoMvguhVKxhjr+PwP1X+MPqUQlwDIc58xI2vNnNmRj4GBRYhe Xuky6819vRXNI8XBpwSj2NuVPVIDplDe3qCUAYKO4JvGwSD/n7MymiEkTRFvQHWLoodoBd T0YNaXAnXHVlYpujx5U3iQQyWYPMD+GQYlxrdbOJPB7SN7NXzkXMIE0kZKE8pfOoIko32T Zp6BdnrGtkMUI/ruYkma/s4JnayCa3hkENB81e7vvb1XRKHHoZbqfYV612GitA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667334818; a=rsa-sha256; cv=none; b=TlqEkvdr0ZoASiZF8id5KKahmUVG94NFs6PGmep01ZTM8GYI/vad09WsrTmXx3W1mA4JVr 1U7ARi2jzROyWs0mg4zAqIeCUWDTwo1YBl7J82Kun2E31CDx1UZ8ip/to3UTRNSyx9W5cp BMSB+MasaM15++vuYB//qCbyoamVgkuJ2uNf9SD3TXKO9pvgP6oOEcrvfyReTS0Q0Ko4ll A8aHjEZffX9mwQZ/AHj3WfLO7l0ZUob/8laJn94K9A12PW31MXc3u0PjJv/zXMXtL7TfeX ACx0Kc97bbHgiFbo6PwW55SKQ6rPRC6OjW7xTtwhgfBL0Ss0Eh23RxXXt43XXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7ab877cb3f9d55a394e43a2c1a1e2711df12226d commit 7ab877cb3f9d55a394e43a2c1a1e2711df12226d Author: Mark Johnston AuthorDate: 2022-10-24 15:55:48 +0000 Commit: Mark Johnston CommitDate: 2022-11-01 13:28:11 +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. Approved by: so PR: 266236 Security: FreeBSD-EN-22:24.zfs (cherry picked from commit 6fe0a6c80a1aff14236924eb33e4013aa8c14f91) (cherry picked from commit 562c9ac58c7678b13f52b0bfe63148e40d7bf63d) --- 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..05d41d4e3b2a 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); dprintf("snapdir fid: fid_gen (%llu) and setgen (%llu)\n", (u_longlong_t)fid_gen, (u_longlong_t)setgen); return (SET_ERROR(EINVAL));