Commit a6c038a5 authored by Felipe Franciosi's avatar Felipe Franciosi Committed by Khalid Elmously

UBUNTU: SAUCE: (no-up) virtio-scsi: Increment reqs counter.

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: f1f609d8 ("UBUNTU: SAUCE: (no-up) virtio-scsi: Fix race in
target free")
Signed-off-by: default avatarFelipe Franciosi <felipe@nutanix.com>
Signed-off-by: default avatarJoseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 57d12f5d
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment