Skip to content

Commit 32a783a

Browse files
kdavemehmetb0
authored andcommitted
btrfs: defrag: change BUG_ON to assertion in btrfs_defrag_leaves()
BugLink: https://bugs.launchpad.net/bugs/2084005 [ Upstream commit 51d4be540054be32d7ce28b63ea9b84ac6ff1db2 ] The BUG_ON verifies a condition that should be guaranteed by the correct use of the path search (with keep_locks and lowest_level set), an assertion is the suitable check. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent d7c54ea commit 32a783a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/defrag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ static int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
521521
* keep_locks set and lowest_level is 1, regardless of the value of
522522
* path->slots[1].
523523
*/
524-
BUG_ON(path->locks[1] == 0);
524+
ASSERT(path->locks[1] != 0);
525525
ret = btrfs_realloc_node(trans, root,
526526
path->nodes[1], 0,
527527
&last_ret,

0 commit comments

Comments
 (0)