]> 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)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Oct 2026 20:36:18 +0000 (21:36 +0100)
commit5dd650d8e5009d0512c96fee2a291978eec4181f
tree2a2606ffd55bfc933134abbf3502594779f5600e
parentd5cafe12079fdddfd83942c9f48d2b4474b55f13
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>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/raid56.c