|
|
Log in / Subscribe / Register

btrfs: raid56: fully support stripe_len < PAGE_SIZE

From:  Qu Wenruo <wqu-AT-suse.com>
To:  linux-btrfs-AT-vger.kernel.org
Subject:  [PATCH 0/3] btrfs: raid56: fully support stripe_len < PAGE_SIZE
Date:  Thu, 22 Oct 2026 20:09:26 +1030
Message-ID:  <cover.1792661955.git.wqu@suse.com>
Archive-link:  Article

Previously the variable stripe_len support for RAID56 intentionally
skips the stripe_len < PAGE_SIZE for partial rbio page allocation and
steal.

The reason is that the existing code assumes a stripe_len can never be
smaller than PAGE_SIZE, thus a page can either either data or P/Q
blocks, not both.

But it turns out that the original code is not unnecessarily complex,
especially for steal_rbio().
We can easily calculate the number of pages to steal/allocate without
any special assumption on stripe_len and PAGE_SIZE.

So add back the proper support for steal_rbio() and partial rbio page
allocation, which also slightly cleanup the steal_rbio() related to
helpers.

Qu Wenruo (3):
  btrfs: introduce rbio_nr_data_sectors() helper
  btrfs: add stripe_len < PAGE_SIZE support for steal_rbio()
  btrfs: add stripe_len < PAGE_SIZE support for alloc_rbio_*_pages()

 fs/btrfs/raid56.c | 182 +++++++++++++---------------------------------
 1 file changed, 51 insertions(+), 131 deletions(-)

-- 
2.56.0




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds