<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/raid56.c, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2026-02-22T01:09:51Z</updated>
<entry>
<title>Convert 'alloc_flex' family to use the new default GFP_KERNEL argument</title>
<updated>2026-02-22T01:09:51Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2026-02-22T01:06:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=323bbfcf1ef8836d0d2ad9e2c1f1c684f0e3b5b3'/>
<id>urn:sha1:323bbfcf1ef8836d0d2ad9e2c1f1c684f0e3b5b3</id>
<content type='text'>
This is the exact same thing as the 'alloc_obj()' version, only much
smaller because there are a lot fewer users of the *alloc_flex()
interface.

As with alloc_obj() version, this was done entirely with mindless brute
force, using the same script, except using 'flex' in the pattern rather
than 'objs*'.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace kmalloc with kmalloc_obj for non-scalar types</title>
<updated>2026-02-21T09:02:28Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2026-02-21T07:49:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=69050f8d6d075dc01af7a5f2f550a8067510366f'/>
<id>urn:sha1:69050f8d6d075dc01af7a5f2f550a8067510366f</id>
<content type='text'>
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>btrfs: raid56: fix memory leak of btrfs_raid_bio::stripe_uptodate_bitmap</title>
<updated>2026-02-03T05:37:29Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2026-01-30T17:06:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=29fb415a6a72c9207d118dd0a7a37184a14a3680'/>
<id>urn:sha1:29fb415a6a72c9207d118dd0a7a37184a14a3680</id>
<content type='text'>
We allocate the bitmap but we never free it in free_raid_bio_pointers().
Fix this by adding a bitmap_free() call against the stripe_uptodate_bitmap
of a raid bio.

Fixes: 1810350b04ef ("btrfs: raid56: move sector_ptr::uptodate into a dedicated bitmap")
Reported-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lore.kernel.org/linux-btrfs/20260126045315.GA31641@lst.de/
Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
Tested-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: raid56: remove the "_step" infix</title>
<updated>2025-11-25T00:50:19Z</updated>
<author>
<name>Qu Wenruo</name>
</author>
<published>2025-11-16T00:02:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a332a6d70475d87067038ab0cbda8292da955e1'/>
<id>urn:sha1:1a332a6d70475d87067038ab0cbda8292da955e1</id>
<content type='text'>
The following functions are introduced as a middle step for bs &gt; ps
support:

- rbio_streip_step_paddr()
- rbio_pstripe_step_paddr()
- rbio_qstripe_step_paddr()
- sector_step_paddr_in_rbio()

As there is already an existing function without the infix, and has a
different parameter list.

But the existing functions have been cleaned up, there is no need to
keep the "_step" infix, just remove it completely.

Signed-off-by: Qu Wenruo &lt;wqu@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: raid56: enable bs &gt; ps support</title>
<updated>2025-11-25T00:48:52Z</updated>
<author>
<name>Qu Wenruo</name>
</author>
<published>2025-11-14T08:45:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8870dbeedcf9576fbc5147654e272acad3d84089'/>
<id>urn:sha1:8870dbeedcf9576fbc5147654e272acad3d84089</id>
<content type='text'>
The support code for bs &gt; ps is complete, enable it and update
assertions.

Signed-off-by: Qu Wenruo &lt;wqu@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: raid56: prepare finish_parity_scrub() to support bs &gt; ps cases</title>
<updated>2025-11-25T00:48:02Z</updated>
<author>
<name>Qu Wenruo</name>
</author>
<published>2025-11-14T04:59:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89ca1a403e541236e56d184634b0e4e5175c0054'/>
<id>urn:sha1:89ca1a403e541236e56d184634b0e4e5175c0054</id>
<content type='text'>
The function finish_parity_scrub() assume each fs block can be mapped by
one page, blocking bs &gt; ps support for raid56.

Prepare it for bs &gt; 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-&gt;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 &gt; ps cases
  Since for bs &gt; ps cases, one fs block needs multiple pages, the
  existing simple check against rbio-&gt;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 &lt;wqu@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: raid56: prepare rbio_bio_add_io_paddr() to support bs &gt; ps cases</title>
<updated>2025-11-25T00:47:54Z</updated>
<author>
<name>Qu Wenruo</name>
</author>
<published>2025-11-14T04:09:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ba88278c69982b2c4007cd1912961fbb60693950'/>
<id>urn:sha1:ba88278c69982b2c4007cd1912961fbb60693950</id>
<content type='text'>
The function rbio_bio_add_io_paddr() assume each fs block can be mapped by
one page, blocking bs &gt; ps support for raid56.

Prepare it for bs &gt; ps cases by:

- Introduce a helper bio_add_paddrs()
  Previously we only need to add a single page to a bio for a fs block,
  but now we need to add multiple pages, this means we can fail halfway.

  In that case we need to properly revert the bio (only for its size
  though) for halfway failed cases.

- Rename rbio_add_io_paddr() to rbio_add_io_paddrs()
  And change the @paddr parameter to @paddrs[].

- Change all callers to use the updated rbio_add_io_paddrs()
  For the @paddrs pointer used for the new function, it can be grabbed
  using sector_paddrs_in_rbio() and rbio_stripe_paddrs() helpers.

Signed-off-by: Qu Wenruo &lt;wqu@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: raid56: prepare steal_rbio() to support bs &gt; ps cases</title>
<updated>2025-11-25T00:47:41Z</updated>
<author>
<name>Qu Wenruo</name>
</author>
<published>2025-11-17T04:09:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=53474a2ae17401821ce83c3b11f3d159f6b3583a'/>
<id>urn:sha1:53474a2ae17401821ce83c3b11f3d159f6b3583a</id>
<content type='text'>
The function steal_rbio() assume each fs block can be mapped by
one page, blocking bs &gt; ps support for raid56.

Prepare it for bs &gt; ps cases by:

- Introduce two helpers to calculate the sector number
  Previously we assume one page will contain at least one fs block, thus
  can use something like "sectors_per_page = PAGE_SIZE / sectorsize;",
  but with bs &gt; ps support that above number will be 0.

  Instead introduce two helpers:

  * page_nr_to_sector_nr()
    Returns the sector number of the first sector covered by the page.

  * page_nr_to_num_sectors()
    Return how many sectors are covered by the page.

  And use the returned values for bitmap operations other than
  open-coded "PAGE_SIZE / sectorsize".
  Those helpers also have extra ASSERT()s to catch weird numbers.

- Use above helpers
  The involved functions are:
  * steal_rbio_page()
  * is_data_stripe_page()
  * full_page_sectors_uptodate()

Signed-off-by: Qu Wenruo &lt;wqu@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: raid56: prepare set_bio_pages_uptodate() to support bs &gt; ps cases</title>
<updated>2025-11-25T00:47:31Z</updated>
<author>
<name>Qu Wenruo</name>
</author>
<published>2025-11-17T03:27:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05ddf35a5d3d8d58323d6353f2bad026e9838af8'/>
<id>urn:sha1:05ddf35a5d3d8d58323d6353f2bad026e9838af8</id>
<content type='text'>
The function set_bio_pages_uptodate() assume each fs block can be mapped by
one page, blocking bs &gt; ps support for raid56.

Prepare it for bs &gt; ps cases by:

- Update find_stripe_sector_nr() to check only the first step paddr
  We don't need to check each paddr, as the bios are still aligned to fs
  block size, thus checking the first step is enough.

- Use step size to iterate the bio
  This means we only need to find the sector number for the first step
  of each fs block, and skip the remaining part.

Signed-off-by: Qu Wenruo &lt;wqu@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: raid56: prepare verify_bio_data_sectors() to support bs &gt; ps cases</title>
<updated>2025-11-25T00:47:20Z</updated>
<author>
<name>Qu Wenruo</name>
</author>
<published>2025-11-14T04:00:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=64e7b8c7c5873ad03e108d775fa1c0063a320070'/>
<id>urn:sha1:64e7b8c7c5873ad03e108d775fa1c0063a320070</id>
<content type='text'>
The function verify_bio_data_sectors() assume each fs block can be mapped by
one page, blocking bs &gt; ps support for raid56.

Prepare it for bs &gt; ps cases by:

- Make get_bio_sector_nr() to consider bs &gt; ps cases
  The function is utilized to calculate the sector number of a device
  bio submitted by btrfs raid56 layer.

- Assemble a local paddrs[] for checksum calculation

- Open code btrfs_check_block_csum()
  btrfs_check_block_csum() only supports fs blocks backed by large
  folios.

  But for raid56 we can have fs blocks backed by multiple non-contiguous
  pages, e.g. direct IO, encoded read/write/send.

  So instead of using btrfs_check_block_csum(), open code it to use
  btrfs_calculate_block_csum_pages().

Signed-off-by: Qu Wenruo &lt;wqu@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
</feed>
