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

From
Xixin Liu <hidden>
Date
2026-08-07 06:57:56
Also in
lkml, virtualization
Reply to
Michael S. Tsirkin, 2026-08-02
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
Thread (16 messages) 16 messages, 3 authors, last reply 2026-08-07
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help