The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Haris Iqbal <haris.iqbal@linux.dev>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Keith Busch <kbusch@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org
Subject: Re: [v4 0/3] block: delay support for error injection
Date: Tue, 1 Dec 2026 22:34:16 +0100	[thread overview]
Message-ID: <f2effaaa-0cfa-43a8-a5ce-015ba36ca80b@linux.dev> (raw)
In-Reply-To: <20261130080659.GA8222@lst.de>



On 11/30/26 09:06, Christoph Hellwig wrote:
> On Thu, Nov 26, 2026 at 08:29:46AM -0700, Jens Axboe wrote:
>> Gah, yes that is certainly a mistake, in my mind I had it staged for 7.5
>> of course. But looks like that ship sailed, as it's now in Linus's tree
>> as well as part of updates from last week. How broken is this right now,
>> in terms of what fix(es) we need? We can always just disable it. For
>> 7.5, we can just pull in the block-7.4 branch and resolve the conflicts
>> that way, fairly straight forward and usual approach.
> 
> The sashiko report is here:
> 
> https://sashiko.dev/#/patchset/20261111215838.103356-1-haris.iqbal%40linux.dev
> 
> The main issue is bios outliving the gendisks.  Which feels like it
> could be hit relatively easily, and might even happen for typical
> test case uses.  Of course none of this matters if you don't use
> the new feature, but I think sending a revert to Linus and then
> reapplying it in 7.5 is probably the best.


I was looking into the report and the scenarios, and I think part of 
this is real, but I'm not sure the rest can happen.

The delayed bio is resubmitted through submit_bio_noacct_nocheck(), 
which skips bio_check_eod(). If the disk is removed while the bio waits, 
I think the bio can still reach the driver on sd/sr, because their queue 
is unfrozen again after del_gendisk(). So this part makes sense and I 
think failing the bio in the work when GD_DEAD should fix it.

I don't think the use-after-free through nvme multipath can happen. Path
disks are hidden, so their bdev is never added and disk_live() is false,
and error_inject_add() returns -ENODEV for a disk that isn't live. I 
tried it with nvme-loop: writing a rule to the path disk's 
eror_injection file fails with ENODEV. If that's right, a bio is never 
delayed on a path disk, only on the head disk.

So I'm thinking of adding just the GD_DEAD check. One thing I'd like an 
opinion on: a delayed bio holds no q_usage_counter, so del_gendisk() 
doesn't wait for it, and only the issuer's open keeps the disk 
allocated. Is that fine to rely on, or should the delayed bio take its 
own reference on the bdev (and the driver module) for the duration of 
the delay?



      reply	other threads:[~2026-12-01 21:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 21:58 [v4 0/3] block: delay support for error injection Md Haris Iqbal
2026-11-11 21:58 ` [v4 1/3] block: Reject unknown status tags in error injection rules Md Haris Iqbal
2026-11-12 13:53   ` Christoph Hellwig
2026-11-11 21:58 ` [v4 2/3] block: allow error injection rules to delay bios Md Haris Iqbal
2026-11-12 13:54   ` Christoph Hellwig
2026-11-11 21:58 ` [v4 3/3] Documentation: block: document error injection delay feature Md Haris Iqbal
2026-11-12 13:54   ` Christoph Hellwig
2026-11-18 16:07 ` [v4 0/3] block: delay support for error injection Jens Axboe
2026-11-20 16:44   ` Christoph Hellwig
2026-11-21 11:27     ` Haris Iqbal
2026-11-26  1:49       ` Jens Axboe
2026-11-26  8:34         ` Christoph Hellwig
2026-11-26 15:29           ` Jens Axboe
2026-11-30  8:06             ` Christoph Hellwig
2026-12-01 21:34               ` Haris Iqbal [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=f2effaaa-0cfa-43a8-a5ce-015ba36ca80b@linux.dev \
    --to=haris.iqbal@linux.dev \
    --cc=axboe@kernel.dk \
    --cc=corbet@lwn.net \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox