mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
btrfs: fix off-by-one end offset check in report_setget_bounds()
The addressable range with an extent buffer goes from byte 0 to byte
eb->len - 1, so if a byte address matches eb->len, it's already beyond
the addressable range and we should log that it's bad start address
and not end address.
Fixes: 234fdd2815 ("btrfs: remove redundant check in up check_setget_bounds")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Daniel Vacek <neelx@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
22bdddf40e
commit
08f750d9f8
|
|
@ -16,7 +16,7 @@ static void __cold report_setget_bounds(const struct extent_buffer *eb,
|
|||
|
||||
btrfs_warn(eb->fs_info,
|
||||
"bad eb member %s: ptr 0x%lx start %llu member offset %lu size %d",
|
||||
(member_offset > eb->len ? "start" : "end"),
|
||||
(member_offset >= eb->len ? "start" : "end"),
|
||||
(unsigned long)ptr, eb->start, member_offset, size);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user