diff mbox series

[09/14] btrfs: change BUG_ON to assertion in tree_move_down()

Message ID 513e4f7646b52d79f2bf37eaafc39c9cd074a475.1707382595.git.dsterba@suse.com (mailing list archive)
State New, archived
Headers show
Series More error handling and BUG_ON cleanups | expand

Commit Message

David Sterba Feb. 8, 2024, 8:59 a.m. UTC
There's only one caller of tree_move_down() that does not pass level 0
so the assertion is better suited here.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/send.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 7a601de7fa7c..e96d511f9dd9 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -7438,8 +7438,8 @@  static int tree_move_down(struct btrfs_path *path, int *level, u64 reada_min_gen
 	u64 reada_done = 0;
 
 	lockdep_assert_held_read(&parent->fs_info->commit_root_sem);
+	ASSERT(*level != 0);
 
-	BUG_ON(*level == 0);
 	eb = btrfs_read_node_slot(parent, slot);
 	if (IS_ERR(eb))
 		return PTR_ERR(eb);