ACK: [SRU][Xenial][PATCH 1/1] UBUNTU: SAUCE: (no-up) virtio-scsi: Increment reqs counter.
Khaled Elmously
khalid.elmously at canonical.com
Fri Jun 8 19:02:17 UTC 2018
On 2018-06-08 13:48:27 , Joseph Salisbury wrote:
> From: Felipe Franciosi <felipe at nutanix.com>
>
> BugLink: http://bugs.launchpad.net/bugs/1775235
>
> virtio-scsi itself is broken in a way that it doesn't increment the
> 'reqs' counter when submitting requests on MQ in certain conditions.
> That caused the counter to go to -1 (on the completion of the first
> request) and the CPU to hang indefinitely.
>
> Fixes: f1f609d8015e ("UBUNTU: SAUCE: (no-up) virtio-scsi: Fix race in
> target free")
>
> Signed-off-by: Felipe Franciosi <felipe at nutanix.com>
> Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
> ---
> drivers/scsi/virtio_scsi.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
> index e2da312..b4a41d5 100644
> --- a/drivers/scsi/virtio_scsi.c
> +++ b/drivers/scsi/virtio_scsi.c
> @@ -588,11 +588,12 @@ static int virtscsi_queuecommand_single(struct Scsi_Host *sh,
> }
>
> static struct virtio_scsi_vq *virtscsi_pick_vq_mq(struct virtio_scsi *vscsi,
> - struct scsi_cmnd *sc)
> + struct virtio_scsi_target_state *tgt, struct scsi_cmnd *sc)
> {
> u32 tag = blk_mq_unique_tag(sc->request);
> u16 hwq = blk_mq_unique_tag_to_hwq(tag);
>
> + atomic_inc(&tgt->reqs);
> return &vscsi->req_vqs[hwq];
> }
>
> @@ -642,7 +643,7 @@ static int virtscsi_queuecommand_multi(struct Scsi_Host *sh,
> struct virtio_scsi_vq *req_vq;
>
> if (shost_use_blk_mq(sh))
> - req_vq = virtscsi_pick_vq_mq(vscsi, sc);
> + req_vq = virtscsi_pick_vq_mq(vscsi, tgt, sc);
> else
> req_vq = virtscsi_pick_vq(vscsi, tgt);
>
Acked-by: Khalid Elmously <khalid.elmously at canonical.com>
More information about the kernel-team
mailing list