mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
7816030eb4
commit
354877befa
|
@ -249,8 +249,8 @@ static noinline int cow_file_range_inline(struct btrfs_root *root,
|
|||
data_len = compressed_size;
|
||||
|
||||
if (start > 0 ||
|
||||
actual_end >= PAGE_CACHE_SIZE ||
|
||||
data_len >= BTRFS_MAX_INLINE_DATA_SIZE(root) ||
|
||||
actual_end > PAGE_CACHE_SIZE ||
|
||||
data_len > BTRFS_MAX_INLINE_DATA_SIZE(root) ||
|
||||
(!compressed_size &&
|
||||
(actual_end & (root->sectorsize - 1)) == 0) ||
|
||||
end + 1 < isize ||
|
||||
|
|
Loading…
Reference in New Issue