From: David Sterba <dsterba@suse.cz>
To: David Sterba <dsterba@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 5/5] btrfs: convert ASSERT(0) to DEBUG_WARN()
Date: Tue, 22 Apr 2025 14:06:21 +0200 [thread overview]
Message-ID: <20250422120621.GE3659@twin.jikos.cz> (raw)
In-Reply-To: <ff06b32f979859dbf499bd46d0c7a9464c9c86db.1744881160.git.dsterba@suse.com>
On Thu, Apr 17, 2025 at 11:17:03AM +0200, David Sterba wrote:
> The use of ASSERT(0) is maybe useful for some cases but more like a
> notice for developers. Assertions can be compiled in independently so
> convert it to a debugging helper.
>
> The difference is that it's just a warning and will not end up in BUG().
> All the cases need a review and possibly be modified:
>
> - delete it completely if the purpose is not clear
> - replace/update by proper error handling
> - replace by verbose error and BUG()/transaction abort if continuation
> is not possible at all
> - use DEBUG_WARN()
I've kept only the cases that do ASSERT(0) and error handling, there are
remaining cases for the impossible conditions like unkonwn delayed ref
actions etc, this will need the conversion to the error handling first.
next prev parent reply other threads:[~2025-04-22 12:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 9:16 [PATCH v2 0/5] Assertion and debugging helpers David Sterba
2025-04-17 9:16 ` [PATCH v2 1/5] btrfs: enhance ASSERT() to take optional format string David Sterba
2025-04-17 9:17 ` [PATCH v2 2/5] btrfs: example use of enhanced ASSERT() in volumes.c David Sterba
2025-04-17 9:17 ` [PATCH v2 3/5] btrfs: add debug build only WARN David Sterba
2025-04-17 9:17 ` [PATCH v2 4/5] btrfs: convert WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG)) to DEBUG_WARN David Sterba
2025-04-17 9:17 ` [PATCH v2 5/5] btrfs: convert ASSERT(0) to DEBUG_WARN() David Sterba
2025-04-22 12:06 ` David Sterba [this message]
2025-04-17 12:51 ` [PATCH v2 0/5] Assertion and debugging helpers Josef Bacik
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=20250422120621.GE3659@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=dsterba@suse.com \
--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