Skip to content

Commit

Permalink
Btrfs: check if leaf's parent exists before pushing items around
Browse files Browse the repository at this point in the history
During splitting a leaf, pushing items around to hopefully get some space only
works when we have a parent, ie. we have at least one sibling leaf.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  • Loading branch information
Liu Bo authored and Josef Bacik committed Jun 14, 2013
1 parent fdd99c7 commit 33157e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3986,7 +3986,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
return -EOVERFLOW;

/* first try to make some room by pushing left and right */
if (data_size) {
if (data_size && path->nodes[1]) {
wret = push_leaf_right(trans, root, path, data_size,
data_size, 0, 0);
if (wret < 0)
Expand Down

0 comments on commit 33157e0

Please sign in to comment.