aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/ctree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 6b2ec9089229..fdd8fb4c6075 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -4353,13 +4353,15 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
4353 path->search_for_split = 1; 4353 path->search_for_split = 1;
4354 ret = btrfs_search_slot(trans, root, &key, path, 0, 1); 4354 ret = btrfs_search_slot(trans, root, &key, path, 0, 1);
4355 path->search_for_split = 0; 4355 path->search_for_split = 0;
4356 if (ret > 0)
4357 ret = -EAGAIN;
4356 if (ret < 0) 4358 if (ret < 0)
4357 goto err; 4359 goto err;
4358 4360
4359 ret = -EAGAIN; 4361 ret = -EAGAIN;
4360 leaf = path->nodes[0]; 4362 leaf = path->nodes[0];
4361 /* if our item isn't there or got smaller, return now */ 4363 /* if our item isn't there, return now */
4362 if (ret > 0 || item_size != btrfs_item_size_nr(leaf, path->slots[0])) 4364 if (item_size != btrfs_item_size_nr(leaf, path->slots[0]))
4363 goto err; 4365 goto err;
4364 4366
4365 /* the leaf has changed, it now has room. return now */ 4367 /* the leaf has changed, it now has room. return now */