]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: raid56: prepare finish_parity_scrub() to support bs > ps cases
authorQu Wenruo <wqu@suse.com>
Fri, 14 Nov 2025 04:59:46 +0000 (15:29 +1030)
committerDavid Sterba <dsterba@suse.com>
Tue, 25 Nov 2025 00:48:02 +0000 (01:48 +0100)
commit89ca1a403e541236e56d184634b0e4e5175c0054
tree88d07724961c1e80671626c233ff0089ffc72a9f
parentba88278c69982b2c4007cd1912961fbb60693950
btrfs: raid56: prepare finish_parity_scrub() to support bs > ps cases

The function finish_parity_scrub() assume each fs block can be mapped by
one page, blocking bs > ps support for raid56.

Prepare it for bs > ps cases by:

- Introduce a helper, verify_one_parity_step()
  Since the P/Q generation is always done in a vertical stripe, we have
  to handle the range step by step.

- Only clear the rbio->dbitmap if all steps of an fs block match

- Remove rbio_stripe_paddr() and sector_paddr_in_rbio() helpers
  Now we either use the paddrs version for checksum, or the step version
  for P/Q generation/recovery.

- Make alloc_rbio_essential_pages() to handle bs > ps cases
  Since for bs > ps cases, one fs block needs multiple pages, the
  existing simple check against rbio->stripe_pages[] is not enough.

  Extract a dedicated helper, alloc_rbio_sector_pages(), for the
  existing alloc_rbio_essential_pages(), which is still based on sector
  number.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/raid56.c