btrfs scrub: don't coalesce pages that are logically discontiguous
authorArne Jansen <sensille@gmx.net>
Wed, 25 May 2011 12:22:50 +0000 (12:22 +0000)
committerChris Mason <chris.mason@oracle.com>
Thu, 26 May 2011 21:52:52 +0000 (17:52 -0400)
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>
fs/btrfs/scrub.c

index 87a2f12..6dfed0c 100644 (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;
        }