Skip to content

md/raid5: account discard IO and allow llbitmap discard

Yu Kuai linux-raid lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 2 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] md/raid5: account discard IO and allow llbitmap discard

From: Yu Kuai <[email protected]>

Hi,

This series fixes RAID5 discard accounting and then allows RAID5 discard when llbitmap is enabled.

Patch 1 routes processed RAID5 discard bios through md_account_bio(). Since RAID5 only discards whole data stripes, it accounts the exact full-stripe range that make_discard_request() will submit before restoring the original bio iterator for completion.

Patch 2 allows discard without devices_handle_discard_safely when llbitmap is enabled. Legacy bitmap cannot record discarded/unwritten data and can make later partial writes plus member failure reconstruct inconsistent data. llbitmap records discarded ranges as unwritten, and RAID5 already uses that state to force safe recovery paths before relying on parity.

Runtime validation was done in QEMU with a RAID5 array using a lockless bitmap and discard-capable disks. Multiple aligned and unaligned blkdiscard ranges were issued while tracing md_account_bio() and llbitmap_start_discard(); the llbitmap unwritten-bit deltas matched the traced bitmap ranges.

Yu Kuai (2):
md/raid5: account discard IO
md/raid5: allow discard with llbitmap

 drivers/md/raid5.c | 36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)
Signature · 1 line
2.51.0