Commit 00d01bc1 authored by Arne Jansen's avatar Arne Jansen Committed by Chris Mason

btrfs scrub: don't coalesce pages that are logically discontiguous

scrub_page collects several pages into one bio as long as they are physically
contiguous. As we only save one logical address for the whole bio, don't
collect pages that are physically contiguous but logically discontiguous.
Signed-off-by: default avatarArne Jansen <sensille@gmx.net>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent c309df07
......@@ -631,7 +631,8 @@ static int scrub_page(struct scrub_dev *sdev, u64 logical, u64 len,
if (sbio->count == 0) {
sbio->physical = physical;
sbio->logical = logical;
} else if (sbio->physical + sbio->count * PAGE_SIZE != physical) {
} else if (sbio->physical + sbio->count * PAGE_SIZE != physical ||
sbio->logical + sbio->count * PAGE_SIZE != logical) {
scrub_submit(sdev);
goto again;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment