]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: make sure we stay inside the bvec during __btrfs_lookup_bio_sums
authorChris Mason <clm@fb.com>
Mon, 21 Mar 2016 13:59:09 +0000 (06:59 -0700)
committerChris Mason <clm@fb.com>
Mon, 21 Mar 2016 14:25:44 +0000 (07:25 -0700)
commiteda38ebc384c04d390f6368e37ab0b71de5069f6
tree211ed431e1fa1dc86fc3bee06df56672a9337ece
parentcc367aade94db1d4c8487b7c183395f585f7675e
btrfs: make sure we stay inside the bvec during __btrfs_lookup_bio_sums

Commit 4330bf39ba93373 (Btrfs: Compute and look up csums based on
sectorsized blocks) changes around how we walk the bios while looking up
crcs.  There's an inner loop that is jumping to the next bvec based on
sectors and before it derefs the next bvec, it needs to make sure we're
still in the bio.

In this case, the outer loop would have decided to stop moving forward
too, and the bvec deref is never actually used for anything.  But
CONFIG_DEBUG_PAGEALLOC catches it because we're outside our bio.

Signed-off-by: Chris Mason <clm@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
fs/btrfs/file-item.c