]> git.hungrycats.org Git - linux/commit
btrfs: remove BUG*() from raid56.c
authorQu Wenruo <wqu@suse.com>
Wed, 21 Oct 2026 22:48:47 +0000 (09:18 +1030)
committerQu Wenruo <wqu@suse.com>
Thu, 22 Oct 2026 07:58:16 +0000 (18:28 +1030)
commit05e18b299ed54eebe779face13865f14f4b4b2f5
treed51f221f4c6e3306de6020b315beca23dd2c1267
parent59008e7058bcccd943e9839b430488bbd95ef4a9
btrfs: remove BUG*() from raid56.c

There are several BUG()/BUG_ON() inside raid56.c, which cause
checkpatch warning if code is touching them. This is especially annoying
if using b4, with btrfs-workflow git hooks applied, which makes b4 to
wait for user input but without any output.

Address them by removing one very impossible BUG(), and using ASSERT() for
the remaining ones:

- __remove_rbio_from_cache()
- rbio_is_full()
- unlock_stripe()
  Replace the BUG_ON() with ASSERT().

- finish_parity_scrub()
  Remove the BUG(), as alloc_rbio() has already properly calculated
  real_stripes and nr_data using the number of parity.

  Furthermore, initialize @has_qstripe at the beginning of the function
  using the bioc->map_type directly.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
fs/btrfs/raid56.c