aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2013-05-22 12:07:06 +0000
committerJosef Bacik <jbacik@fusionio.com>2013-06-14 11:29:58 -0400
commit33157e05dbd60c3edd30b56d4dfc7755cae787c5 (patch)
tree2ffe513a580f38f31aad4d16864b9e0828df82eb /fs/btrfs/ctree.c
parentfdd99c729433ed6ab8d02aa4760c6708a6c5de2a (diff)
Btrfs: check if leaf's parent exists before pushing items around
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>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 0a430f7c5af..1c9dc71089c 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -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)