Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions module/os/freebsd/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,7 @@ zfsctl_common_pathconf(struct vop_pathconf_args *ap)
return (0);

case _PC_MIN_HOLE_SIZE:
*ap->a_retval = (int)SPA_MINBLOCKSIZE;
return (0);
return (EINVAL);

case _PC_ACL_EXTENDED:
*ap->a_retval = 0;
Expand Down
17 changes: 15 additions & 2 deletions module/os/freebsd/zfs/zfs_vnops_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -4118,6 +4118,7 @@ zfs_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr,
{
znode_t *zp;
zfsvfs_t *zfsvfs;
uint_t blksize, iosize;
int error;

switch (cmd) {
Expand All @@ -4129,8 +4130,20 @@ zfs_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr,
*valp = 64;
return (0);
case _PC_MIN_HOLE_SIZE:
*valp = (int)SPA_MINBLOCKSIZE;
return (0);
iosize = vp->v_mount->mnt_stat.f_iosize;
if (vp->v_type == VREG) {
zp = VTOZ(vp);
blksize = zp->z_blksz;
if (zp->z_size <= blksize)
blksize = MAX(blksize, iosize);
*valp = (int)blksize;
return (0);
}
if (vp->v_type == VDIR) {
*valp = (int)iosize;
return (0);
}
return (EINVAL);
case _PC_ACL_EXTENDED:
#if 0 /* POSIX ACLs are not implemented for ZFS on FreeBSD yet. */
zp = VTOZ(vp);
Expand Down
Loading