diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 72a3104c71..c065c0c59b 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -278,9 +278,13 @@ zfs_holey_common(struct inode *ip, int cmd, loff_t *off) if (error == ESRCH) return (SET_ERROR(ENXIO)); - /* file was dirty, so fall back to using file_sz logic */ - if (error == EBUSY) - error = 0; + /* 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,