Skip to content

Commit

Permalink
btrfs: fix message not properly printing interval when adding extent map
Browse files Browse the repository at this point in the history
At btrfs_add_extent_mapping(), if we are unable to merge the existing
extent map, we print a warning message that suggests interval ranges in
the form "[X, Y)", where the first element is the inclusive start offset
of a range and the second element is the exclusive end offset. However
we end up printing the length of the ranges instead of the exclusive end
offsets. So fix this by printing the range end offsets.

Reviewed-by: Qu Wenruo <[email protected]>
Reviewed-by: Anand Jain <[email protected]>
Signed-off-by: Filipe Manana <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
fdmanana authored and kdave committed Mar 15, 2024
1 parent 7b3851c commit 0305afd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/extent_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,8 @@ int btrfs_add_extent_mapping(struct btrfs_fs_info *fs_info,
*em_in = NULL;
WARN_ONCE(ret,
"extent map merge error existing [%llu, %llu) with em [%llu, %llu) start %llu\n",
existing->start, existing->len,
orig_start, orig_len, start);
existing->start, extent_map_end(existing),
orig_start, orig_start + orig_len, start);
}
free_extent_map(existing);
}
Expand Down

0 comments on commit 0305afd

Please sign in to comment.