Commit 1f9d44c0 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: replace BUG_ON with ASSERT in walk_down_proc()

We have a couple of areas where we check to make sure the tree block is
locked before looking up or messing with references.  This is old code
so it has this as BUG_ON().  Convert this to ASSERT() for developers.
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent b4236703
...@@ -5391,7 +5391,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans, ...@@ -5391,7 +5391,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans,
if (wc->lookup_info && if (wc->lookup_info &&
((wc->stage == DROP_REFERENCE && wc->refs[level] != 1) || ((wc->stage == DROP_REFERENCE && wc->refs[level] != 1) ||
(wc->stage == UPDATE_BACKREF && !(wc->flags[level] & flag)))) { (wc->stage == UPDATE_BACKREF && !(wc->flags[level] & flag)))) {
BUG_ON(!path->locks[level]); ASSERT(path->locks[level]);
ret = btrfs_lookup_extent_info(trans, fs_info, ret = btrfs_lookup_extent_info(trans, fs_info,
eb->start, level, 1, eb->start, level, 1,
&wc->refs[level], &wc->refs[level],
...@@ -5415,7 +5415,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans, ...@@ -5415,7 +5415,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans,
/* wc->stage == UPDATE_BACKREF */ /* wc->stage == UPDATE_BACKREF */
if (!(wc->flags[level] & flag)) { if (!(wc->flags[level] & flag)) {
BUG_ON(!path->locks[level]); ASSERT(path->locks[level]);
ret = btrfs_inc_ref(trans, root, eb, 1); ret = btrfs_inc_ref(trans, root, eb, 1);
if (ret) { if (ret) {
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment