public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: fdmanana@kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: stop printing condition result in assertion failure messages
Date: Fri, 20 Feb 2026 08:22:47 +1030	[thread overview]
Message-ID: <f8ce2fde-77e9-49ce-b9ca-ae4e43149049@suse.com> (raw)
In-Reply-To: <9c3463215d864eb706860e7d9c853e34d4125408.1771515807.git.fdmanana@suse.com>



在 2026/2/20 02:15, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
> 
> 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.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   fs/btrfs/messages.h | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/messages.h b/fs/btrfs/messages.h
> index 81f59afe4a99..17cdc14dc89d 100644
> --- a/fs/btrfs/messages.h
> +++ b/fs/btrfs/messages.h
> @@ -141,11 +141,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();								\
>   	}									\


  reply	other threads:[~2026-02-19 21:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 15:45 [PATCH] btrfs: stop printing condition result in assertion failure messages fdmanana
2026-02-19 21:52 ` Qu Wenruo [this message]
2026-02-20 17:53 ` David Sterba
2026-02-20 17:59   ` Filipe Manana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8ce2fde-77e9-49ce-b9ca-ae4e43149049@suse.com \
    --to=wqu@suse.com \
    --cc=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox