Skip to content

Commit

Permalink
btrfs scrub: don't coalesce pages that are logically discontiguous
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arne Jansen authored and Chris Mason committed May 26, 2011
1 parent c309df0 commit 00d01bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/scrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 00d01bc

Please sign in to comment.