btrfs: stop printing condition result in assertion failure messages

It's useless to print the result of the condition, it's always 0 if the
assertion is triggered, so it doesn't provide any useful information.

Examples:

   assertion failed: cb->bbio.bio.bi_iter.bi_size == disk_num_bytes :: 0, in inode.c:9991
   assertion failed: folio_test_writeback(folio) :: 0, in subpage.c:476

So stop printing that, it's always ":: 0" for any assertion triggered
(except for conditions that are just an identifier).

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Filipe Manana
2026-02-19 15:37:59 +00:00
committed by David Sterba
parent 1899d9b09d
commit d821d4f6fb

View File

@@ -144,11 +144,11 @@ do { \
verify_assert_printk_format("check the format string" args); \
if (!likely(cond)) { \
if (("" __FIRST_ARG(args) [0]) == 0) { \
pr_err("assertion failed: %s :: %ld, in %s:%d\n", \
#cond, (long)(cond), __FILE__, __LINE__); \
pr_err("assertion failed: %s, in %s:%d\n", \
#cond, __FILE__, __LINE__); \
} else { \
pr_err("assertion failed: %s :: %ld, in %s:%d (" __FIRST_ARG(args) ")\n", \
#cond, (long)(cond), __FILE__, __LINE__ __REST_ARGS(args)); \
pr_err("assertion failed: %s, in %s:%d (" __FIRST_ARG(args) ")\n", \
#cond, __FILE__, __LINE__ __REST_ARGS(args)); \
} \
BUG(); \
} \