Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Oct 2022 16:54:22 +0000
From:      bugzilla-noreply@freebsd.org
To:        fs@FreeBSD.org
Subject:   [Bug 266236] ZFS NFS : .zfs/snapshot : Stale file handle
Message-ID:  <bug-266236-3630-PFQ7FMyMPl@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-266236-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-266236-3630@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266236

Mark Johnston <markj@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |freqlabs@FreeBSD.org,
                   |                            |markj@FreeBSD.org,
                   |                            |mav@FreeBSD.org

--- Comment #13 from Mark Johnston <markj@FreeBSD.org> ---
Reverting https://github.com/openzfs/zfs/pull/12905 does fix the problem for
me.  There is an additional bug there in that there is a missing zfs_exit()
call before the return, which causes a lock leak.

In my case, we end up with fid_gen =3D=3D 4 and setgen =3D=3D 0.  I don't u=
nderstand
where that generation number comes from. zfs_fid() sets it from a ZPL
attribute, and "stat -f '%v'" on the snapshot dir prints 0.=20=20

To repro, I just enabled an NFSv3 server in a VM:

mountd_enable=3D"YES"=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
mountd_flags=3D"-n"=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
nfs_server_enable=3D"YES"=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
rpc_locked_enable=3D"YES"=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
rpc_statd_enable=3D"YES"=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
rpcbind_enable=3D"YES"
zfs_enable=3D"YES"

Create a dataset with a snapshot and export it:

# zfs snapshot test@1
# zfs set sharenfs=3Don test

Mount it locally and check .zfs/snapshot:

# mount localhost:/test /mnt
# ls /mnt/.zfs/snapshot
1
# ls /mnt/.zfs/snapshot/1
snapdir fid: fid_gen (4) and setgen (0)
snapdir fid: fid_gen (4) and setgen (0)
snapdir fid: fid_gen (4) and setgen (0)
ls: /mnt/.zfs/snapshot/1: Stale NFS file handle

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-266236-3630-PFQ7FMyMPl>