mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
btrfs: warn if extent buffer mapping crosses a page boundary in csum_tree_block
Since commit d2e174d5d3
("btrfs: document extent mapping assumptions in
checksum") we have a comment in place why map_private_extent_buffer()
can't return 1 in the csum_tree_block() case.
Make this a bit more explicit and WARN_ON() in case this this assumption
breaks.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
2996e1f8bc
commit
c53839fc32
1 changed files with 1 additions and 1 deletions
|
@ -285,7 +285,7 @@ static int csum_tree_block(struct extent_buffer *buf, u8 *result)
|
|||
*/
|
||||
err = map_private_extent_buffer(buf, offset, 32,
|
||||
&kaddr, &map_start, &map_len);
|
||||
if (err)
|
||||
if (WARN_ON(err))
|
||||
return err;
|
||||
cur_len = min(len, map_len - (offset - map_start));
|
||||
crc = btrfs_csum_data(kaddr + offset - map_start,
|
||||
|
|
Loading…
Reference in a new issue