Skip to content

Commit

Permalink
fiemap: fix get_extent
Browse files Browse the repository at this point in the history
fe_logical starts at 0 while the len starts at 1

Signed-off-by: Alexandre Bruyelles <[email protected]>
  • Loading branch information
JackSlateur committed Nov 16, 2023
1 parent 99727e7 commit 774ff6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fiemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct fiemap_extent *get_extent(struct fiemap *fiemap, size_t loff,

for (unsigned int i = 0; i < fiemap->fm_mapped_extents; i++) {
extent = &fiemap->fm_extents[i];
ext_end_off = extent->fe_logical + extent->fe_length;
ext_end_off = extent->fe_logical + extent->fe_length - 1;
if (ext_end_off < loff)
continue;

Expand Down

0 comments on commit 774ff6a

Please sign in to comment.