Re: [PATCH 01/19] btrfs: require at least 4 devices for RAID 6

From
David Sterba <hidden>
Date
2026-05-13 20:19:31
Also in
linux-arch, linux-arm-kernel, linux-btrfs, linux-crypto, linux-raid, linux-riscv, linux-s390, lkml, loongarch
Reply to
Christoph Hellwig, 2026-05-13
On Wed, May 13, 2026 at 07:47:42AM +0200, Christoph Hellwig wrote:
On Tue, May 12, 2026 at 01:42:31PM +0200, David Sterba wrote:
quoted
On Tue, May 12, 2026 at 07:20:41AM +0200, Christoph Hellwig wrote:
quoted
While the RAID6 algorithm could in theory support 3 devices by just
copying the data disk to the two parity disks, this version is not only
useless because it is a suboptimal version of 3-way mirroring, but also
broken with various crashes and incorrect parity generation in various
architecture-optimized implementations.  Disallow it similar to mdraid
which requires at least 4 devices for RAID 6.

Fixes: 53b381b3abeb ("Btrfs: RAID5 and RAID6")
Signed-off-by: Christoph Hellwig <hch@lst.de>
This patch should have been sent separately as it has user visible
impact and can potentially break some setups.
It _is_ sent out separate.
It's public interface change of btrfs but in a patch series cleaning
up some library code, I noticed it by accident.
quoted
The degenerate modes of
raid0, 5, or 6 are explicit as a possible middle step when converting
profiles.  We can use a fallback implementation for this case if the
accelerated implementations cannot do it.
This is not about a degenerated mode.  For a degenerated RAID 6, parity
generation uses the RAID 5 XOR routines as the second parity will be
missing.  This is about generating two parities for a single data disk,
which must be explicitly selected.
The calcuation is a different than what I'm concened about, changing
minimum devices from 3 to 4 is a breaking change. If the library won't
provide the xor/parity functions then we'll have to add a fallback for
this special case.
Thread (37 messages) 37 messages, 10 authors, last reply 2026-06-26
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help