From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Jonathan Corbet <corbet@lwn.net>,
Damien Le Moal <dlemoal@kernel.org>,
Hannes Reinecke <hare@suse.de>, Keith Busch <kbusch@kernel.org>,
linux-block@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: configurable block error injection v4
Date: Wed, 10 Jun 2026 15:11:47 +0200 [thread overview]
Message-ID: <20260610131147.GA25086@lst.de> (raw)
In-Reply-To: <20260610051015.1906799-1-hch@lst.de>
Sashiko had two comments on this:
- the one about the race of removal vs. addition is spot on, and
trivially fixed by actually removing the code (unlock/lock cycle).
- the other about zero-sized commands is valid, but more of an
enhancement. And one that if implemented right now actually
make things worse, as flushed actually show up as empty writes
with the preflush bit and not as REQ_OP_FLUSH. So if we'd special
case zero-sized bios, we'd make a flush hit all write rules,
which would defeat the point. We really need to do flushes as
REQ_OP_FLUSH at the bio level :(
Below is what I plan to fold in, and I'm thinking of the empty bio
issue above can be caught in a comment or the documentation nicely.
diff --git a/block/error-injection.c b/block/error-injection.c
index 7f7f0d3327bc..3bc91f199dc7 100644
--- a/block/error-injection.c
+++ b/block/error-injection.c
@@ -119,11 +119,7 @@ static void error_inject_removeall(struct gendisk *disk)
while ((inj = list_first_entry_or_null(&disk->error_injection_list,
struct blk_error_inject, entry))) {
list_del_rcu(&inj->entry);
- mutex_unlock(&disk->error_injection_lock);
-
kfree_rcu_mightsleep(inj);
-
- mutex_lock(&disk->error_injection_lock);
}
static_branch_dec(&blk_error_injection_enabled);
mutex_unlock(&disk->error_injection_lock);
prev parent reply other threads:[~2026-06-10 13:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 5:08 configurable block error injection v4 Christoph Hellwig
2026-06-10 5:08 ` [PATCH 1/4] block: add a macro to initialize the status table Christoph Hellwig
2026-06-10 5:08 ` [PATCH 2/4] block: add a "tag" for block status codes Christoph Hellwig
2026-06-10 5:08 ` [PATCH 3/4] block: add a str_to_blk_op helper Christoph Hellwig
2026-06-10 5:08 ` [PATCH 4/4] block: add configurable error injection Christoph Hellwig
2026-06-10 13:11 ` Christoph Hellwig [this message]
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=20260610131147.GA25086@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=corbet@lwn.net \
--cc=dlemoal@kernel.org \
--cc=hare@suse.de \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-doc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox