Re: [PATCH v2 2/2] virtio-blk: mark disk dead on ERS permanent failure

From: Xixin Liu

Date: Fri Aug 07 2026 - 02:58:20 EST


Hi Michael,

Thanks for the review. I will post a v3 with the following.

On Sun, Aug 02, 2026 at 04:59:08PM -0400, Michael S. Tsirkin wrote:
> what happens with requests already outstanding in the queues?
> e.g. does this leak memory?

virtio_driver.shutdown runs on system shutdown via virtio_dev_shutdown.
It calls blk_mq_freeze_queue() first: every in-flight request holds a
q_usage_counter reference until virtblk_done frees it, so freeze
returns only after those completions have reclaimed the request PDU
and any chained sg. Only then does it virtio_break_device() and
blk_mark_disk_dead(). Break must come after freeze; after break,
vring callbacks no longer run.

> So this is blk specifically, I am somewhat lost as to why
> is blk treated differently from other drivers here.

virtio-blk owns the gendisk and request_queue itself, so block
teardown and queue lifetime sit in virtio-blk, not in virtio-pci
common code.

In v3, AER perm_failure stays common for every virtio device:
virtio_break_device() and DISCONNECT only. Patch 2 keeps the
blk-side pieces in virtio-blk: system-shutdown .shutdown does freeze,
break, and mark_disk_dead, plus the queue_rq guard after frozen
del_vqs. Neither is wired from AER.

Thanks,
Xixin