Btrfs: fix off-by-one in cow_file_range_inline()
authorWang Shilong <[email protected]>
Thu, 17 Jul 2014 03:44:11 +0000 (11:44 +0800)
committerChris Mason <[email protected]>
Wed, 17 Sep 2014 20:37:39 +0000 (13:37 -0700)
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 <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
fs/btrfs/inode.c

index d1c69beb054f4692eeead80275a3ac509511cb48..75c6de26405cd561420e951c7a6608bd27b5e158 100644 (file)
@@ -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 ||