<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/sysfs.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-03-18T19:35:49Z</updated>
<entry>
<title>btrfs: allow debug builds to accept 2K block size</title>
<updated>2025-03-18T19:35:49Z</updated>
<author>
<name>Qu Wenruo</name>
</author>
<published>2025-02-25T02:33:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=306a75e647fe0ccb060d5098ee0829e418f01818'/>
<id>urn:sha1:306a75e647fe0ccb060d5098ee0829e418f01818</id>
<content type='text'>
Currently we only support two block sizes, 4K and PAGE_SIZE.

This means on the most common architecture x86_64, we have no way to
test subpage block size.  And that's exactly I have an aarch64 machine
dedicated for subpage tests.

But this is still a hurdle for a lot of btrfs developers, and to improve
the test coverage mostly on x86_64, here we enable debug builds to
accept 2K block size.

This involves:

- Introduce a dedicated minimal block size macro
  BTRFS_MIN_BLOCKSIZE, which depends on if CONFIG_BTRFS_DEBUG is set.
  If so it's 2K, otherwise it's 4K as usual.

- Allow 4K, PAGE_SIZE and BTRFS_MIN_BLOCKSIZE as block size

- Update subpage block size checks to be based on BTRFS_MIN_BLOCKSIZE

- Export the new supported blocksize through sysfs interfaces

As most of the subpage support is already pretty mature, there is no
extra work needed to support the extra 2K block size.

Signed-off-by: Qu Wenruo &lt;wqu@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: sysfs: accept size suffixes for read policy values</title>
<updated>2025-03-18T19:35:48Z</updated>
<author>
<name>Anand Jain</name>
</author>
<published>2025-01-29T15:21:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a66b39f699cbd9125c0f248d18fc1381265ee42c'/>
<id>urn:sha1:a66b39f699cbd9125c0f248d18fc1381265ee42c</id>
<content type='text'>
We now parse human-friendly size values (e.g. '1G', '2M') when setting
read policies.

Signed-off-by: Anand Jain &lt;anand.jain@oracle.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: replace deprecated strncpy() with strscpy()</title>
<updated>2025-02-26T08:24:01Z</updated>
<author>
<name>Thorsten Blum</name>
</author>
<published>2025-02-25T19:26:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2df2c6ed89600a02e1c7a581a6a55e53c38ce0f5'/>
<id>urn:sha1:2df2c6ed89600a02e1c7a581a6a55e53c38ce0f5</id>
<content type='text'>
strncpy() is deprecated for NUL-terminated destination buffers. Use
strscpy() instead and don't zero-initialize the param array.

Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum &lt;thorsten.blum@linux.dev&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: configure read policy via module parameter</title>
<updated>2025-01-13T13:53:21Z</updated>
<author>
<name>Anand Jain</name>
</author>
<published>2025-01-01T18:06:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e426286cfa6f85e51006f6151b309a395ada6540'/>
<id>urn:sha1:e426286cfa6f85e51006f6151b309a395ada6540</id>
<content type='text'>
For testing purposes allow to configure the read policy via module
parameter from the beginning. Available only with CONFIG_BTRFS_EXPERIMENTAL

Examples:

- Set the RAID1 balancing method to round-robin with a custom
  min_contig_read of 4k:
  $ modprobe btrfs read_policy=round-robin:4096

- Set the round-robin balancing method with the default
  min_contiguous_read:
  $ modprobe btrfs read_policy=round-robin

- Set the "devid" balancing method, defaulting to the latest device:
  $ modprobe btrfs read_policy=devid

Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: add read policy to set a preferred device</title>
<updated>2025-01-13T13:53:21Z</updated>
<author>
<name>Anand Jain</name>
</author>
<published>2025-01-01T18:06:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c86aae73bd5882e4a6b4e1b6ed448ea902551f80'/>
<id>urn:sha1:c86aae73bd5882e4a6b4e1b6ed448ea902551f80</id>
<content type='text'>
Add read policy that will force all reads to go to the given device
(specified by devid) on the RAID1 profiles.

This will be used for testing, e.g. to read from stale device. Users may
find other use cases.

Can be set in sysfs, the value format is "devid:&lt;devid&gt;" to the file

  /sys/fs/btrfs/FSID/read_policy

Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: introduce RAID1 round-robin read balancing</title>
<updated>2025-01-13T13:53:21Z</updated>
<author>
<name>Anand Jain</name>
</author>
<published>2025-01-01T18:06:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d7a9154955e50c0b991063c65f86ab24796754e'/>
<id>urn:sha1:6d7a9154955e50c0b991063c65f86ab24796754e</id>
<content type='text'>
Add round-robin read policy that balances reads over available devices
(all RAID1 block group profiles). Switch to the next devices is done
after a number of blocks is read, which is 256K by default and is
configurable in sysfs.

The format is "round-robin:&lt;min-contig-read&gt;" and can be set in file

  /sys/fs/btrfs/FSID/read_policy

Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: sysfs: handle value associated with read balancing policy</title>
<updated>2025-01-13T13:53:21Z</updated>
<author>
<name>Anand Jain</name>
</author>
<published>2025-01-01T18:06:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b6bed20ed398f71069bfd2cd769bb91fa15859b5'/>
<id>urn:sha1:b6bed20ed398f71069bfd2cd769bb91fa15859b5</id>
<content type='text'>
Enable specifying additional configuration values along the RAID1
balancing read policy in a single input string.

Update btrfs_read_policy_to_enum() to parse and handle a value
associated with the policy in the format "policy:value", the value part
if present is converted to 64-bit integer.

Signed-off-by: Anand Jain &lt;anand.jain@oracle.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: sysfs: add btrfs_read_policy_to_enum() helper and refactor read policy store</title>
<updated>2025-01-13T13:53:21Z</updated>
<author>
<name>Anand Jain</name>
</author>
<published>2025-01-01T18:06:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38cae63137d5e13dc3c2ba88c4f393be4a6bf4bb'/>
<id>urn:sha1:38cae63137d5e13dc3c2ba88c4f393be4a6bf4bb</id>
<content type='text'>
Introduce btrfs_read_policy_to_enum() helper to simplify the conversion
of a string read policy to its corresponding enum value. This reduces
duplication and improves code clarity in btrfs_read_policy_store().

The parameter is copied locally to allow modification, enabling the
separation of the method and its value. This prepares for the addition of
more functionality in subsequent patches.

Signed-off-by: Anand Jain &lt;anand.jain@oracle.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: sysfs: refactor output formatting in btrfs_read_policy_show()</title>
<updated>2025-01-13T13:53:20Z</updated>
<author>
<name>Anand Jain</name>
</author>
<published>2025-01-01T18:06:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83be7f8b9c24bd040a348577c7c84fd08911707f'/>
<id>urn:sha1:83be7f8b9c24bd040a348577c7c84fd08911707f</id>
<content type='text'>
Refactor the logic in btrfs_read_policy_show() for easier extension with
more balancing methods.  Streamline the space and bracket handling
around the active policy without altering the functional output.  This
is in preparation to add more methods.

Signed-off-by: Anand Jain &lt;anand.jain@oracle.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: sysfs: fix direct super block member reads</title>
<updated>2024-12-23T21:06:44Z</updated>
<author>
<name>Qu Wenruo</name>
</author>
<published>2024-12-18T06:30:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fca432e73db2bec0fdbfbf6d98d3ebcd5388a977'/>
<id>urn:sha1:fca432e73db2bec0fdbfbf6d98d3ebcd5388a977</id>
<content type='text'>
The following sysfs entries are reading super block member directly,
which can have a different endian and cause wrong values:

- sys/fs/btrfs/&lt;uuid&gt;/nodesize
- sys/fs/btrfs/&lt;uuid&gt;/sectorsize
- sys/fs/btrfs/&lt;uuid&gt;/clone_alignment

Thankfully those values (nodesize and sectorsize) are always aligned
inside the btrfs_super_block, so it won't trigger unaligned read errors,
just endian problems.

Fix them by using the native cached members instead.

Fixes: df93589a1737 ("btrfs: export more from FS_INFO to sysfs")
CC: stable@vger.kernel.org
Reviewed-by: Naohiro Aota &lt;naohiro.aota@wdc.com&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Signed-off-by: Qu Wenruo &lt;wqu@suse.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
</feed>
