Skip to content

Commit

Permalink
dmu_offset_next can return EBUSY on ZoL - handle it the way Linux does
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmacy committed Mar 8, 2019
1 parent e10a5fb commit e309a86
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions module/os/freebsd/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ zfs_holey(vnode_t *vp, u_long cmd, offset_t *off)
if (error == ESRCH)
return (SET_ERROR(ENXIO));

/* file was dirty, so fall back to using generic logic */
if (error == EBUSY) {
if (hole)
*off = file_sz;

return (0);
}

/*
* We could find a hole that begins after the logical end-of-file,
* because dmu_offset_next() only works on whole blocks. If the
Expand Down

0 comments on commit e309a86

Please sign in to comment.