Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD .zfs fixups #14774

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions module/os/freebsd/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ sfs_vgetx(struct mount *mp, int flags, uint64_t parent_id, uint64_t id,
return (error);
}

#if __FreeBSD_version >= 1400077
vn_set_state(vp, VSTATE_CONSTRUCTED);
#endif

*vpp = vp;
return (0);
}
Expand Down Expand Up @@ -675,6 +679,17 @@ zfsctl_root_readdir(struct vop_readdir_args *ap)

ASSERT3S(vp->v_type, ==, VDIR);

/*
* FIXME: this routine only ever emits 3 entries and does not tolerate
* being called with a buffer too small to handle all of them.
*
* The check below facilitates the idiom of repeating calls until the
* count to return is 0.
*/
if (zfs_uio_offset(&uio) == 3 * sizeof(entry)) {
return (0);
}

error = sfs_readdir_common(zfsvfs->z_root, ZFSCTL_INO_ROOT, ap, &uio,
&dots_offset);
if (error != 0) {
Expand Down