]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: fix message not properly printing interval when adding extent map
authorFilipe Manana <fdmanana@suse.com>
Wed, 13 Mar 2024 13:02:02 +0000 (13:02 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Mar 2024 15:42:39 +0000 (16:42 +0100)
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 <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_map.c

index 2cfc6e8cf76f290f6fc8694add53f58068d4ec1d..16685cb8a91d8561e86861a93197de219760c0f9 100644 (file)
@@ -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);
                }