Skip to content

Commit 1886b77

Browse files
fdmananakdave
authored andcommitted
btrfs: use verbose assert at peek_discard_list()
We now have a verbose variant of ASSERT() so that we can print the value of the block group's discard_index. So use it for better problem analysis in case the assertion is triggered. Reviewed-by: Boris Burkov <[email protected]> Reviewed-by: Daniel Vacek <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 1b66042 commit 1886b77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/btrfs/discard.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ static struct btrfs_block_group *peek_discard_list(
256256
* the discard lists.
257257
*/
258258
ASSERT(block_group->discard_index !=
259-
BTRFS_DISCARD_INDEX_UNUSED);
259+
BTRFS_DISCARD_INDEX_UNUSED,
260+
"discard_index=%d",
261+
block_group->discard_index);
260262
} else {
261263
list_del_init(&block_group->discard_list);
262264
btrfs_put_block_group(block_group);

0 commit comments

Comments
 (0)