[PATCH 8/9] block: hold a request_queue reference for the lifetime of struct gendisk

Ming Lei ming.lei at redhat.com
Fri Aug 20 06:42:58 PDT 2021


On Mon, Aug 16, 2021 at 03:19:09PM +0200, Christoph Hellwig wrote:
> Acquire the queue ref dropped in disk_release in __blk_alloc_disk so any
> allocate gendisk always has a queue reference.

BTW, today Markus reported that request queue is released when the
disk is still live.

And looks it is triggered when running virtio-scsi hotplug from qemu
side, and the reason could be that we grab the request queue refcount
after disk is added to driver core, so there is small race window in
which the request queue is released before we grab it in __device_add_disk().

I guess this patch could fix the issue, but it is hard to verify
since it takes days to reproduce.


Thanks,
Ming




More information about the Linux-nvme mailing list