aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Manana <[email protected]>2022-09-01 14:18:26 +0100
committerDavid Sterba <[email protected]>2022-09-26 12:28:00 +0200
commit09fbc1c8e7b00e260b18049af71bf8ca8c4cba99 (patch)
tree409bbb15d7521a69af9d6ba6c587cbac66daa22e
parent33a86cfa1741ef1668b0d312c7964b4f35e9d31e (diff)
btrfs: allow fiemap to be interruptible
Doing fiemap on a file with a very large number of extents can take a very long time, and we have reports of it being too slow (two recent examples in the Link tags below), so make it interruptible. Link: https://lore.kernel.org/linux-btrfs/[email protected]/ Link: https://lore.kernel.org/linux-btrfs/[email protected]/ Reviewed-by: Josef Bacik <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
-rw-r--r--fs/btrfs/extent_io.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 8f143c10d81b..28e49a4a9eb9 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -5623,6 +5623,11 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
ret = 0;
goto out_free;
}
+
+ if (fatal_signal_pending(current)) {
+ ret = -EINTR;
+ goto out_free;
+ }
}
out_free:
if (!ret)