Commit 00d01bc17cc2807292303961519d9c005794eb1d

Authored by Arne Jansen
Committed by Chris Mason
1 parent c309df0786

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>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

... ... @@ -631,7 +631,8 @@
631 631 if (sbio->count == 0) {
632 632 sbio->physical = physical;
633 633 sbio->logical = logical;
634   - } else if (sbio->physical + sbio->count * PAGE_SIZE != physical) {
  634 + } else if (sbio->physical + sbio->count * PAGE_SIZE != physical ||
  635 + sbio->logical + sbio->count * PAGE_SIZE != logical) {
635 636 scrub_submit(sdev);
636 637 goto again;
637 638 }