From: Jeff Mahoney Date: Thu, 12 Feb 2009 15:06:15 +0000 (-0500) Subject: Btrfs: balance_level checks !child after access X-Git-Tag: upstream/snapshot3+hdmi~19966^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7951f3cefbd711f4429a0cd014aa83a844c399a0;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Btrfs: balance_level checks !child after access The BUG_ON() is in the wrong spot. Signed-off-by: Jeff Mahoney Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 35443cc..6674692 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -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);