Skip to content

Commit c53839f

Browse files
Johannes Thumshirnkdave
authored andcommitted
btrfs: warn if extent buffer mapping crosses a page boundary in csum_tree_block
Since commit d2e174d ("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 <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 2996e1f commit c53839f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/disk-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static int csum_tree_block(struct extent_buffer *buf, u8 *result)
285285
*/
286286
err = map_private_extent_buffer(buf, offset, 32,
287287
&kaddr, &map_start, &map_len);
288-
if (err)
288+
if (WARN_ON(err))
289289
return err;
290290
cur_len = min(len, map_len - (offset - map_start));
291291
crc = btrfs_csum_data(kaddr + offset - map_start,

0 commit comments

Comments
 (0)