diff options
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index c4bc570a396e..babf7fbaec84 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -3040,6 +3040,10 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans, | |||
3040 | if (ret > 0 || item_size != btrfs_item_size_nr(leaf, path->slots[0])) | 3040 | if (ret > 0 || item_size != btrfs_item_size_nr(leaf, path->slots[0])) |
3041 | goto err; | 3041 | goto err; |
3042 | 3042 | ||
3043 | /* the leaf has changed, it now has room. return now */ | ||
3044 | if (btrfs_leaf_free_space(root, path->nodes[0]) >= ins_len) | ||
3045 | goto err; | ||
3046 | |||
3043 | if (key.type == BTRFS_EXTENT_DATA_KEY) { | 3047 | if (key.type == BTRFS_EXTENT_DATA_KEY) { |
3044 | fi = btrfs_item_ptr(leaf, path->slots[0], | 3048 | fi = btrfs_item_ptr(leaf, path->slots[0], |
3045 | struct btrfs_file_extent_item); | 3049 | struct btrfs_file_extent_item); |