aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandan Rajendra <chandan@linux.vnet.ibm.com>2016-01-21 05:26:01 -0500
committerDavid Sterba <dsterba@suse.com>2016-02-01 13:24:29 -0500
commit0c29ba993e4b08771deb20f8717a4b57cc7e678b (patch)
tree78f0190cfc726cfc63c154f2b64945147bcfd71c
parent5f4dc8fc835bbb902f5c2aa3de3978f3f518aa73 (diff)
Btrfs: Limit inline extents to root->sectorsize
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>
-rw-r--r--fs/btrfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 9dd4fb4afce9..7cda82006de9 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -263,7 +263,7 @@ static noinline int cow_file_range_inline(struct btrfs_root *root,
263 data_len = compressed_size; 263 data_len = compressed_size;
264 264
265 if (start > 0 || 265 if (start > 0 ||
266 actual_end > PAGE_CACHE_SIZE || 266 actual_end > root->sectorsize ||
267 data_len > BTRFS_MAX_INLINE_DATA_SIZE(root) || 267 data_len > BTRFS_MAX_INLINE_DATA_SIZE(root) ||
268 (!compressed_size && 268 (!compressed_size &&
269 (actual_end & (root->sectorsize - 1)) == 0) || 269 (actual_end & (root->sectorsize - 1)) == 0) ||