From patchwork Wed May 25 12:22:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Jansen X-Patchwork-Id: 816002 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4PCMwtB016584 for ; Wed, 25 May 2011 12:22:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756964Ab1EYMWz (ORCPT ); Wed, 25 May 2011 08:22:55 -0400 Received: from ysabell.rzone.de ([81.169.144.237]:65358 "EHLO ysabell.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756919Ab1EYMWz (ORCPT ); Wed, 25 May 2011 08:22:55 -0400 Received: from gargravarr.store (gargravarr.store [192.168.42.236]) by ysabell.rzone.de (Postfix) with ESMTP id C121EA86; Wed, 25 May 2011 14:22:51 +0200 (MEST) Received: by gargravarr.store (Postfix, from userid 32466) id 5720AC079; Wed, 25 May 2011 14:22:50 +0200 (CEST) From: Arne Jansen To: chris.mason@oracle.com, linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs scrub: don't coalesce pages that are logically discontiguous Date: Wed, 25 May 2011 14:22:50 +0200 Message-Id: <1306326170-28208-1-git-send-email-sensille@gmx.net> X-Mailer: git-send-email 1.7.3.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 25 May 2011 12:22:58 +0000 (UTC) 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 --- fs/btrfs/scrub.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index a31f2a9..21ee93c 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -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; }