Skip to content

Commit

Permalink
FreeBSD: add missing fplookup_vexec handler to special vop vectors
Browse files Browse the repository at this point in the history
Otherwise lookup can fail with EOPNOTSUPP or panic.

Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Matt Macy <[email protected]>
Signed-off-by: Mateusz Guzik <[email protected]>
Closes openzfs#11066
  • Loading branch information
mjguzik authored and behlendorf committed Oct 15, 2020
1 parent 34cda44 commit 41e2b3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions module/os/freebsd/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,9 @@ zfsctl_common_getacl(struct vop_getacl_args *ap)

static struct vop_vector zfsctl_ops_root = {
.vop_default = &default_vnodeops,
#if __FreeBSD_version >= 1300121
.vop_fplookup_vexec = VOP_EAGAIN,
#endif
.vop_open = zfsctl_common_open,
.vop_close = zfsctl_common_close,
.vop_ioctl = VOP_EINVAL,
Expand Down Expand Up @@ -1113,6 +1116,9 @@ zfsctl_snapdir_getattr(struct vop_getattr_args *ap)

static struct vop_vector zfsctl_ops_snapdir = {
.vop_default = &default_vnodeops,
#if __FreeBSD_version >= 1300121
.vop_fplookup_vexec = VOP_EAGAIN,
#endif
.vop_open = zfsctl_common_open,
.vop_close = zfsctl_common_close,
.vop_getattr = zfsctl_snapdir_getattr,
Expand Down Expand Up @@ -1214,6 +1220,9 @@ zfsctl_snapshot_vptocnp(struct vop_vptocnp_args *ap)
*/
static struct vop_vector zfsctl_ops_snapshot = {
.vop_default = NULL, /* ensure very restricted access */
#if __FreeBSD_version >= 1300121
.vop_fplookup_vexec = VOP_EAGAIN,
#endif
.vop_inactive = zfsctl_snapshot_inactive,
#if __FreeBSD_version >= 1300045
.vop_need_inactive = vop_stdneed_inactive,
Expand Down
3 changes: 3 additions & 0 deletions module/os/freebsd/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -6641,6 +6641,9 @@ VFS_VOP_VECTOR_REGISTER(zfs_fifoops);
*/
struct vop_vector zfs_shareops = {
.vop_default = &default_vnodeops,
#if __FreeBSD_version >= 1300121
.vop_fplookup_vexec = VOP_EAGAIN,
#endif
.vop_access = zfs_freebsd_access,
.vop_inactive = zfs_freebsd_inactive,
.vop_reclaim = zfs_freebsd_reclaim,
Expand Down

0 comments on commit 41e2b3d

Please sign in to comment.