All of lore.kernel.org
 help / color / mirror / Atom feed
From: Md Haris Iqbal <haris.iqbal@linux.dev>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org, Md Haris Iqbal <haris.iqbal@linux.dev>
Subject: [PATCH 2/2] block: copy BIO_ERROR_INJECTED to the split in bio_split()
Date: Sat,  5 Dec 2026 13:55:09 +0100	[thread overview]
Message-ID: <20261205125510.29717-5-haris.iqbal@linux.dev> (raw)
In-Reply-To: <20261205125510.29717-1-haris.iqbal@linux.dev>

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
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")
Signed-off-by: Md Haris Iqbal <haris.iqbal@linux.dev>
---
 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


  parent reply	other threads:[~2026-12-05 12:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 12:55 [PATCH for-rc 0/3] block: error injection delay fixes Md Haris Iqbal
2026-12-05 12:55 ` [PATCH for-rc 1/3] block: fail a delayed bio if its disk was removed Md Haris Iqbal
2026-12-05 12:55 ` [PATCH 1/2] block: hold the disk while error injection delays a bio Md Haris Iqbal
2026-12-05 12:59   ` Haris Iqbal
2026-12-05 14:06     ` Jens Axboe
2026-12-05 14:18       ` Haris Iqbal
2026-12-05 12:55 ` [PATCH for-rc 2/3] block: clear BIO_ERROR_INJECTED when a bio changes device Md Haris Iqbal
2026-12-05 12:55 ` Md Haris Iqbal [this message]
2026-12-05 12:59   ` [PATCH 2/2] block: copy BIO_ERROR_INJECTED to the split in bio_split() Haris Iqbal
2026-12-05 12:55 ` [PATCH for-rc 3/3] " Md Haris Iqbal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261205125510.29717-5-haris.iqbal@linux.dev \
    --to=haris.iqbal@linux.dev \
    --cc=axboe@kernel.dk \
    --cc=corbet@lwn.net \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.