From 00d01bc17cc2807292303961519d9c005794eb1d Mon Sep 17 00:00:00 2001 From: Arne Jansen Date: Wed, 25 May 2011 12:22:50 +0000 Subject: [PATCH] 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 Signed-off-by: Chris Mason --- fs/btrfs/scrub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 87a2f1273136..6dfed0c27ac3 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -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; } -- GitLab