From: Wang Shilong Date: Thu, 17 Jul 2014 03:44:11 +0000 (+0800) Subject: Btrfs: fix off-by-one in cow_file_range_inline() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=354877befa852e9b62ddc92a6cc017210e982d46;p=linux-beck.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 Reviewed-by: David Sterba Signed-off-by: Chris Mason --- 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, 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 ||