From patchwork Wed Dec 11 23:38:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandra Seetharaman X-Patchwork-Id: 3329051 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A9AC19F37C for ; Wed, 11 Dec 2013 23:41:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06A4420806 for ; Wed, 11 Dec 2013 23:41:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 356E2207CA for ; Wed, 11 Dec 2013 23:41:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884Ab3LKXlC (ORCPT ); Wed, 11 Dec 2013 18:41:02 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:40500 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880Ab3LKXlB (ORCPT ); Wed, 11 Dec 2013 18:41:01 -0500 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Dec 2013 16:41:00 -0700 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 11 Dec 2013 16:40:58 -0700 Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 6CAB41FF001A for ; Wed, 11 Dec 2013 16:40:35 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp08025.gho.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBBLd3dl6947182 for ; Wed, 11 Dec 2013 22:39:03 +0100 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBBNevBK031787 for ; Wed, 11 Dec 2013 16:40:58 -0700 Received: from localfs-p1-lp01.austin.ibm.com (localfs-p1-lp01.austin.ibm.com [9.3.192.137]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id rBBNedZ7029578; Wed, 11 Dec 2013 16:40:57 -0700 From: Chandra Seetharaman To: linux-btrfs@vger.kernel.org Cc: Chandra Seetharaman Subject: [PATCH 6/7] btrfs: subpagesize-blocksize: Handle relocation clusters appropriately Date: Wed, 11 Dec 2013 17:38:41 -0600 Message-Id: <1386805122-23972-7-git-send-email-sekharan@us.ibm.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1386805122-23972-1-git-send-email-sekharan@us.ibm.com> References: <1386805122-23972-1-git-send-email-sekharan@us.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13121123-0928-0000-0000-000004960A7E Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For relocation clusters boundaries are at blocks, hence in the case of subpagesize-blocksize, we need to make sure the data in the page is handled correctly with the cluster boundary. This patch does that. Signed-off-by: Chandra Seetharaman --- fs/btrfs/relocation.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index ce459a7..fb5752a 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -3149,11 +3149,13 @@ static int relocate_file_extent_cluster(struct inode *inode, set_page_extent_mapped(page); if (nr < cluster->nr && - page_start + offset == cluster->boundary[nr]) { + page_start + offset <= cluster->boundary[nr] && + page_end + offset >= cluster->boundary[nr]) { set_extent_bits(&BTRFS_I(inode)->io_tree, page_start, page_end, EXTENT_BOUNDARY, GFP_NOFS); - nr++; + while (page_end + offset < cluster->boundary[nr]) + nr++; } btrfs_set_extent_delalloc(inode, page_start, page_end, NULL);