mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 02:49:32 +03:00
FreeBSD: Fix a pair of bugs in zfs_fhtovp()
- 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.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Andriy Gapon <avg@FreeBSD.org>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Fixes: 43dbf88178
("FreeBSD: vfsops: use setgen for error case")
Closes #14001
Closes #13974
This commit is contained in:
parent
4dcc2bde9c
commit
ed566bf1cd
@ -1818,7 +1818,8 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp)
|
|||||||
return (SET_ERROR(EINVAL));
|
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",
|
dprintf("snapdir fid: fid_gen (%llu) and setgen (%llu)\n",
|
||||||
(u_longlong_t)fid_gen, (u_longlong_t)setgen);
|
(u_longlong_t)fid_gen, (u_longlong_t)setgen);
|
||||||
return (SET_ERROR(EINVAL));
|
return (SET_ERROR(EINVAL));
|
||||||
|
Loading…
Reference in New Issue
Block a user