]> git.ipfire.org Git - thirdparty/linux.git/commit
md/raid5: validate discard support at request time
authorYu Kuai <yukuai@fygo.io>
Fri, 5 Jun 2026 07:26:38 +0000 (15:26 +0800)
committerYu Kuai <yukuai@fygo.io>
Sat, 20 Jun 2026 19:16:24 +0000 (03:16 +0800)
commit90573092673cdbb2f28f0932fd40de65c3f762cf
treea7b759db85c5edd2fa9e39ceb58bcc42bd56f001
parent74ddbf98e2db646ec58f7e7731c936b7a4a470fe
md/raid5: validate discard support at request time

Raid5 used to disable discard limits when devices_handle_discard_safely
was not set or when stacked member limits could not support a full-stripe
discard. That hides discard from userspace before raid5 can decide whether
a request can be handled safely.

Follow other virtual drivers and advertise a UINT_MAX discard limit for the
md device. Cache lower discard support in r5conf when setting queue limits,
and reject unsupported discard bios before queuing stripe work.

Link: https://patch.msgid.link/20260605072639.2434847-3-yukuai@kernel.org
Signed-off-by: Yu Kuai <yukuai@fygo.io>
drivers/md/raid5.c
drivers/md/raid5.h