Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 354877be authored by Wang Shilong's avatar Wang Shilong Committed by Chris Mason
Browse files

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: default avatarWang Shilong <wangsl.fnst@cn.fujitsu.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 7816030e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 ||