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.