aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authordbavatar <[email protected]>2017-04-24 12:38:31 -0400
committerBrian Behlendorf <[email protected]>2017-04-24 09:38:31 -0700
commit6e03ec4fa26110dcdf817401a375399f3432ae21 (patch)
tree3ea0a332f64ae7509fd8c14710551ef0b3055a07 /module
parentb717b11cb0267a024ece6dc424b6575c685196fc (diff)
Fix lseek result when dnode is dirty
Fixup commit 66aca24. We should have equivalent return values as generic_file_llseek() and advance to end of file. Reviewed-by: Richard Yao <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Tested-by: bunder2015 <[email protected]> Signed-off-by: Debabrata Banerjee <[email protected]> Closes #6050 Closes #6053
Diffstat (limited to 'module')
-rw-r--r--module/zfs/zfs_vnops.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index 72a3104c7..c065c0c59 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,