Re: [v4 0/3] block: delay support for error injection

From: Haris Iqbal

Date: Tue Dec 01 2026 - 16:34:34 EST




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?