Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
	}