diff options
author | Wang Shilong <wangsl.fnst@cn.fujitsu.com> | 2014-07-16 23:44:11 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-17 16:37:39 -0400 |
commit | 354877befa852e9b62ddc92a6cc017210e982d46 (patch) | |
tree | 2b10b2f8bd487eae38f0d8a82d5ba7bbd6548136 /fs | |
parent | 7816030eb48e00a36ecdc23d484b960922feee67 (diff) |
Btrfs: fix off-by-one in cow_file_range_inline()
Btrfs could still inline file data if its size is same as
page size, so don't skip max value here.
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d1c69beb054f..75c6de26405c 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -249,8 +249,8 @@ static noinline int cow_file_range_inline(struct btrfs_root *root, | |||
249 | data_len = compressed_size; | 249 | data_len = compressed_size; |
250 | 250 | ||
251 | if (start > 0 || | 251 | if (start > 0 || |
252 | actual_end >= PAGE_CACHE_SIZE || | 252 | actual_end > PAGE_CACHE_SIZE || |
253 | data_len >= BTRFS_MAX_INLINE_DATA_SIZE(root) || | 253 | data_len > BTRFS_MAX_INLINE_DATA_SIZE(root) || |
254 | (!compressed_size && | 254 | (!compressed_size && |
255 | (actual_end & (root->sectorsize - 1)) == 0) || | 255 | (actual_end & (root->sectorsize - 1)) == 0) || |
256 | end + 1 < isize || | 256 | end + 1 < isize || |