mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 22:25:03 +00:00
btrfs: convert logic BUG_ON()'s in replace_path to ASSERT()'s
[ Upstream commit 7a9213a935
]
A few BUG_ON()'s in replace_path are purely to keep us from making
logical mistakes, so replace them with ASSERT()'s.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3260434687
commit
567c831044
1 changed files with 3 additions and 3 deletions
|
@ -1836,8 +1836,8 @@ int replace_path(struct btrfs_trans_handle *trans, struct reloc_control *rc,
|
||||||
int ret;
|
int ret;
|
||||||
int slot;
|
int slot;
|
||||||
|
|
||||||
BUG_ON(src->root_key.objectid != BTRFS_TREE_RELOC_OBJECTID);
|
ASSERT(src->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID);
|
||||||
BUG_ON(dest->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID);
|
ASSERT(dest->root_key.objectid != BTRFS_TREE_RELOC_OBJECTID);
|
||||||
|
|
||||||
last_snapshot = btrfs_root_last_snapshot(&src->root_item);
|
last_snapshot = btrfs_root_last_snapshot(&src->root_item);
|
||||||
again:
|
again:
|
||||||
|
@ -1871,7 +1871,7 @@ int replace_path(struct btrfs_trans_handle *trans, struct reloc_control *rc,
|
||||||
struct btrfs_key first_key;
|
struct btrfs_key first_key;
|
||||||
|
|
||||||
level = btrfs_header_level(parent);
|
level = btrfs_header_level(parent);
|
||||||
BUG_ON(level < lowest_level);
|
ASSERT(level >= lowest_level);
|
||||||
|
|
||||||
ret = btrfs_bin_search(parent, &key, level, &slot);
|
ret = btrfs_bin_search(parent, &key, level, &slot);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|
Loading…
Reference in a new issue