Thread (9 messages) 9 messages, 4 authors, 2021-09-07

Re: [PATCH v2] btrfs: replace BUG_ON() in btrfs_csum_one_bio() with proper error handling

From: David Sterba <hidden>
Date: 2021-09-07 14:13:29

On Tue, Aug 17, 2021 at 07:55:40AM +0800, Qu Wenruo wrote:
There is a BUG_ON() in btrfs_csum_one_bio() to catch code logic error.

It has indeed caught several bugs during subpage development.

But the BUG_ON() itself will bring down the whole system which is
sometimes overkilled.

Replace it with a WARN() and exit gracefully, so that it won't crash the
whole system while we can still catch the code logic error.

Signed-off-by: Qu Wenruo <redacted>
---
Changelog:
v2:
- Re-send as an independent patch
- Add WARN() to catch the code logic error
Added to misc-next, without changes. The way with separate condition and
WARN is ok for now.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help