]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
virtio-blk: fix hw_queue stopped on arbitrary error
authorHalil Pasic <pasic@linux.ibm.com>
Fri, 13 Mar 2020 12:31:43 +0000 (13:31 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 16 Mar 2020 11:31:53 +0000 (12:31 +0100)
commitd575d420c52960079c76e16e33c9d6cad9c904db
treee1696362ced3db9d5c3c4f8c47a61d3ffc1c0ff5
parent1b33ff9b19a841a264a4789ad2d69718e4c302c6
virtio-blk: fix hw_queue stopped on arbitrary error

BugLink: https://bugs.launchpad.net/bugs/1867109
Since nobody else is going to restart our hw_queue for us, the
blk_mq_start_stopped_hw_queues() is in virtblk_done() is not sufficient
necessarily sufficient to ensure that the queue will get started again.
In case of global resource outage (-ENOMEM because mapping failure,
because of swiotlb full) our virtqueue may be empty and we can get
stuck with a stopped hw_queue.

Let us not stop the queue on arbitrary errors, but only on -EONSPC which
indicates a full virtqueue, where the hw_queue is guaranteed to get
started by virtblk_done() before when it makes sense to carry on
submitting requests. Let us also remove a stale comment.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Cc: Jens Axboe <axboe@kernel.dk>
Fixes: f7728002c1c7 ("virtio_ring: fix return code on DMA mapping fails")
Link: https://lore.kernel.org/r/20200213123728.61216-2-pasic@linux.ibm.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit f5f6b95c72f7f8bb46eace8c5306c752d0133daa)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/block/virtio_blk.c