Re: [PATCH] md/raid5: complete unsupported discards successfully

From: Konstantin Nikiforov

Date: Sat Nov 21 2026 - 16:55:51 EST


Hi Kuai,

A short follow-up to my tested-by report: I removed the udev rule that
zeroed discard_max_bytes from the md75 initramfs and disabled the host
copy, then tested the real HDD-backed stack with an actual discard.

Same kernel: 7.4.0-rc2-md75+, md-7.5 tip c526b7cd32f7 with b964c9240a37.
The stack advertises discard again:

md126: discard_max_bytes=2199023255040, discard_granularity=1048576
bcache0: discard_max_bytes=2199023255040, discard_granularity=512

devices_handle_discard_safely is still at its default (N), so this is the
raid5_discard_limits() path the patch changes.

I created a 1G scratch LV on vgpcrd5 (dm -> bcache0 -> md126 on the three
ST1000DM010 HDDs) and issued one 64M discard:

blkdiscard -o 0 -l 64M /dev/vgpcrd5/discardtest-md75
exit 0
/sys/block/bcache0/bcache/io_errors = 0
bch_count_backing_io_errors in dmesg = 0

So the real bcache -> md126 -> HDD path also completes unsupported discards
successfully, not just the loop reproducer. That was the last test item
pending from my earlier report.

Thanks,
Konstantin
DeepSeek Flash v4.1