On 4/17/26 3:57 PM, Mike Christie wrote:
        cmd_per_lun = virtscsi_config_get(vdev, cmd_per_lun) ?: 1;
-       shost->cmd_per_lun = min_t(u32, cmd_per_lun, shost->can_queue);
+       if (cmd_per_lun == U32_MAX)
+               shost->cmd_per_lun = SCSI_UNLIMITED_CMD_PER_LUN;
+       else
+               shost->cmd_per_lun = min_t(u32, cmd_per_lun, shost->can_queue);

Although this has not been introduced by this patch: shost->cmd_per_lun is a signed 16-bits variable and can_queue has type u32 so the above
assignment can cause integer truncation.

Thanks,

Bart.

Reply via email to