Skip to content

Commit

Permalink
Btrfs: balance_level checks !child after access
Browse files Browse the repository at this point in the history
The BUG_ON() is in the wrong spot.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Jeff Mahoney authored and Chris Mason committed Feb 12, 2009
1 parent b335b00 commit 7951f3c
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 @@ -917,9 +917,9 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,

/* promote the child to a root */
child = read_node_slot(root, mid, 0);
BUG_ON(!child);
btrfs_tree_lock(child);
btrfs_set_lock_blocking(child);
BUG_ON(!child);
ret = btrfs_cow_block(trans, root, child, mid, 0, &child, 0);
BUG_ON(ret);

Expand Down

0 comments on commit 7951f3c

Please sign in to comment.