]> git.hungrycats.org Git - linux/commit
dm: add the stripfault target, a raid56 read-modify-write test fixture
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 2 Oct 2026 05:08:32 +0000 (01:08 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Wed, 28 Oct 2026 20:54:55 +0000 (16:54 -0400)
commit493cea52681fc7b0c1e4105f625a636a9f9e7512
treec38637f481789f91b73310889145654cdcacd5b1
parentbf921b86bdf225f19ffd41533f5c779fba99012e
dm: add the stripfault target, a raid56 read-modify-write test fixture

dm-stripfault cuts a device into blocks of <block_sectors> and makes block N
bad when (N + <base>) % <modulus> == 0, unless it holds a whitelisted sector.
A bad block's reads complete with fresh random bytes every time, and its
writes, write-zeroes and discards complete without reaching the device.
Everything else is passed through like dm-linear.

Laid under the members of a btrfs raid5/6 filesystem with a different
<base> per member, it puts at most one bad strip in each full stripe.  Every
correct path survives that: full-stripe writes, and reads repaired from the
other strips after a checksum mismatch.  A read-modify-write that folds an
unverified read of a bad strip into parity does not: the random bytes it
read never come back, so the parity no longer reconstructs that strip.  With
<modulus> 1 on a single member it is a whole silently-failing device whose
superblock copies (whitelisted) stay current.

  Table:  <dev> <offset> <block_sectors> <modulus> <base> [<n> <sector>...]
  Status: <bad reads> <dropped writes> <dropped discards>

Bios are split at block boundaries (max_io_len = block_sectors), so a bio
never straddles a good and a bad block.

This is a test fixture for the btrfs raid56 work (the strip-fault test and
the octopus CORRUPT role of the validation harness), kept on its own topic
so it can be dropped before upstream submission.

Assisted-by: Claude:claude-opus-5-5
drivers/md/Kconfig
drivers/md/Makefile
drivers/md/dm-stripfault.c [new file with mode: 0644]