From: Liu Bo Date: Wed, 22 May 2013 12:07:06 +0000 (+0000) Subject: Btrfs: check if leaf's parent exists before pushing items around X-Git-Tag: v3.11-rc1~70^2~45 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=33157e05dbd60c3edd30b56d4dfc7755cae787c5;p=cascardo%2Flinux.git 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 Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 0a430f7c5afd..1c9dc71089ce 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)