From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e23smtp05.au.ibm.com ([202.81.31.147]:42524 "EHLO e23smtp05.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753257AbbFAPZE (ORCPT ); Mon, 1 Jun 2015 11:25:04 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 2 Jun 2015 01:25:02 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 8B2702BB0040 for ; Tue, 2 Jun 2015 01:25:00 +1000 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t51FOqKi62849082 for ; Tue, 2 Jun 2015 01:25:00 +1000 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t51FOQNw028084 for ; Tue, 2 Jun 2015 01:24:28 +1000 From: Chandan Rajendra To: clm@fb.com, jbacik@fb.com, dsterba@suse.cz, bo.li.liu@oracle.com Cc: Chandan Rajendra , linux-btrfs@vger.kernel.org, chandan@mykolab.com Subject: [RFC PATCH V11 20/21] Btrfs: subpagesize-blockssize: Limit inline extents to root->sectorsize. Date: Mon, 1 Jun 2015 20:52:55 +0530 Message-Id: <1433172176-8742-21-git-send-email-chandan@linux.vnet.ibm.com> In-Reply-To: <1433172176-8742-1-git-send-email-chandan@linux.vnet.ibm.com> References: <1433172176-8742-1-git-send-email-chandan@linux.vnet.ibm.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: cow_file_range_inline() limits the size of an inline extent to PAGE_CACHE_SIZE. This breaks in subpagesize-blocksize scenarios. Fix this by comparing against root->sectorsize. Signed-off-by: Chandan Rajendra --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 1684339..4d42123 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -258,7 +258,7 @@ static noinline int cow_file_range_inline(struct btrfs_root *root, data_len = compressed_size; if (start > 0 || - actual_end > PAGE_CACHE_SIZE || + actual_end > root->sectorsize || data_len > BTRFS_MAX_INLINE_DATA_SIZE(root) || (!compressed_size && (actual_end & (root->sectorsize - 1)) == 0) || -- 2.1.0