Skip to content

Commit

Permalink
Fix lseek result when dnode is dirty
Browse files Browse the repository at this point in the history
Fixup commit 99b2905

We should have equivalent return values as generic_file_llseek()

Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
  • Loading branch information
dbavatar committed Apr 21, 2017
1 parent d6418de commit 4f21a00
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions module/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4f21a00

Please sign in to comment.