summaryrefslogtreecommitdiff
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2021-05-24 13:43:56 -0400
committerTejun Heo <tj@kernel.org>2021-05-24 13:43:56 -0400
commitc2a11971549b16a24cce81250d84b63d53499fd0 (patch)
tree7bfa4b1c61ec5ad44834a3e38da3d4958517a00f /fs/btrfs/extent_io.c
parentf4f809f66b7545b89bff4b132cdb37adc2d2c157 (diff)
parent08b2b6fdf6b26032f025084ce2893924a0cdb4a2 (diff)
downloadlwn-c2a11971549b16a24cce81250d84b63d53499fd0.tar.gz
lwn-c2a11971549b16a24cce81250d84b63d53499fd0.zip
Merge branch 'for-5.13-fixes' into for-5.14
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 074a78a202b8..83b9c64ba76e 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -5196,7 +5196,7 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
u64 start, u64 len)
{
int ret = 0;
- u64 off = start;
+ u64 off;
u64 max = start + len;
u32 flags = 0;
u32 found_type;
@@ -5231,6 +5231,11 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
goto out_free_ulist;
}
+ /*
+ * We can't initialize that to 'start' as this could miss extents due
+ * to extent item merging
+ */
+ off = 0;
start = round_down(start, btrfs_inode_sectorsize(inode));
len = round_up(max, btrfs_inode_sectorsize(inode)) - start;