On 22/04/2026 14:15, Hannes Reinecke wrote:
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -352,18 +352,20 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
      if (scsi_device_is_pseudo_dev(sdev))
          return sdev;
-    depth = sdev->host->cmd_per_lun ?: 1;
+    if (sdev->host->cmd_per_lun != SCSI_UNLIMITED_CMD_PER_LUN) {
+        depth = sdev->host->cmd_per_lun ?: 1;
Why don't we use a simple flag in the host (or host template) to
indicate that cmd_per_lun should be ignored?
I'm not in favour of using magic values for a setting which
otherwise is a limit.
Look to dev_loss_tmo as a bad example ...

I think it's better to not have a flag and also keep cmd_per_lun, as then we need to sanitize one vs the other. As mentioned in the cover letter response, cmd_per_lun could be got rid off / reworked.

Personally I also dislike how the scsi budget code checks for a budget map being non-NULL (which is for reserved scsi devices, which doesn't need a per-sdev budget map).

Reply via email to