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: Arne Jansen <sensille@gmx.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Arne Jansen 2011-05-25 12:22:50 +00:00 committed by Chris Mason
parent c309df0786
commit 00d01bc17c
1 changed files with 2 additions and 1 deletions

View File

@ -631,7 +631,8 @@ again:
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;
}