On 5/30/19 2:35 PM, John Garry wrote:
On 29/05/2019 14:28, Hannes Reinecke wrote:

 static int virtscsi_map_queues(struct Scsi_Host *shost)
@@ -827,6 +830,8 @@ static int virtscsi_probe(struct virtio_device *vdev)
     shost->max_channel = 0;
     shost->max_cmd_len = VIRTIO_SCSI_CDB_SIZE;
     shost->nr_hw_queues = num_queues;
+    shost->can_queue -= VIRTIO_SCSI_RESERVED_CMDS;

shost->can_queue is already referenced after it is set earlier in virtscsi_probe(), so I wonder if this is ok to later revise it? See:

shost->cmd_per_lun = min_t(u32, cmd_per_lun, shost->can_queue);

Yeah, I think it is correct.
But I'll be checking.

Cheers,

Hannes

Reply via email to