[PATCH for-rc 3/3] block: copy BIO_ERROR_INJECTED to the split in bio_split()
From: Md Haris Iqbal
Date: Sat Dec 05 2026 - 07:56:09 EST
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 <sashiko-bot@xxxxxxxxxx>
Link: https://sashiko.dev/#/patchset/20261111215838.103356-1-haris.iqbal%40linux.dev?part=2
Signed-off-by: Md Haris Iqbal <haris.iqbal@xxxxxxxxx>
---
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