Btrfs: Limit inline extents to root->sectorsize
authorChandan Rajendra <chandan@linux.vnet.ibm.com>
Thu, 21 Jan 2016 10:26:01 +0000 (15:56 +0530)
committerDavid Sterba <dsterba@suse.com>
Mon, 1 Feb 2016 18:24:29 +0000 (19:24 +0100)
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.

Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index 9dd4fb4..7cda820 100644 (file)
@@ -263,7 +263,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) ||