diff options
-rw-r--r-- | fs/btrfs/ctree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 17a3ff2f1828..32922643b5bc 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -294,6 +294,10 @@ static int balance_level(struct btrfs_trans_handle *trans, struct btrfs_root | |||
294 | parent_buf = path->nodes[level + 1]; | 294 | parent_buf = path->nodes[level + 1]; |
295 | pslot = path->slots[level + 1]; | 295 | pslot = path->slots[level + 1]; |
296 | 296 | ||
297 | /* | ||
298 | * deal with the case where there is only one pointer in the root | ||
299 | * by promoting the node below to a root | ||
300 | */ | ||
297 | if (!parent_buf) { | 301 | if (!parent_buf) { |
298 | struct btrfs_buffer *child; | 302 | struct btrfs_buffer *child; |
299 | u64 blocknr = mid_buf->blocknr; | 303 | u64 blocknr = mid_buf->blocknr; |
@@ -1043,6 +1047,7 @@ static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root | |||
1043 | int ret; | 1047 | int ret; |
1044 | int wret; | 1048 | int wret; |
1045 | 1049 | ||
1050 | /* first try to make some room by pushing left and right */ | ||
1046 | wret = push_leaf_left(trans, root, path, data_size); | 1051 | wret = push_leaf_left(trans, root, path, data_size); |
1047 | if (wret < 0) | 1052 | if (wret < 0) |
1048 | return wret; | 1053 | return wret; |