BIO_ERROR_INJECTED keeps a bio that was delayed by an error injection rule from being evaluated again when it is resubmitted. bio_split() does not copy the flag to the split. raid10_handle_discard() resubmits the front split of an unaligned discard to the md device, so a discard delayed by a rule on that device has its front part evaluated, and possibly delayed, a second time. Copy the flag in bio_split(), as is already done for BIO_TRACE_COMPLETION. Fixes: 6bd856cc9996 ("block: allow error injection rules to delay bios") Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20261111215838.103356-1-haris.iqbal%40linux.dev?part=2 Signed-off-by: Md Haris Iqbal --- block/bio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/bio.c b/block/bio.c index b0fcc69de653..0bf72f7b9f4d 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1962,6 +1962,8 @@ struct bio *bio_split(struct bio *bio, int sectors, if (bio_flagged(bio, BIO_TRACE_COMPLETION)) bio_set_flag(split, BIO_TRACE_COMPLETION); + if (bio_flagged(bio, BIO_ERROR_INJECTED)) + bio_set_flag(split, BIO_ERROR_INJECTED); return split; } -- 2.53.0