diff options
author | Debabrata Banerjee <[email protected]> | 2017-03-24 17:28:38 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-04-13 10:51:20 -0700 |
commit | 66aca24730adfb2e3875e5148a03dd1fb435d438 (patch) | |
tree | 12ce4a9e59a64c7a207703a0525238a86ba012f2 /module/zfs/zfs_vnops.c | |
parent | a44e7faa6c63998a4c058901a5c587706abe56ab (diff) |
SEEK_HOLE should not block on txg_wait_synced()
Force flushing of txg's can be painfully slow when competing for disk
IO, since this is a process meant to execute asynchronously. Optimize
this path via allowing data/hole seeking if the file is clean, but if
dirty fall back to old logic. This is a compromise to disabling the
feature entirely.
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Debabrata Banerjee <[email protected]>
Closes #4306
Closes #5962
Diffstat (limited to 'module/zfs/zfs_vnops.c')
-rw-r--r-- | module/zfs/zfs_vnops.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 4afae6c36..72a3104c7 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -278,6 +278,10 @@ 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; + /* * We could find a hole that begins after the logical end-of-file, * because dmu_offset_next() only works on whole blocks. If the |