Commit ef10b169 authored by James Bottomley's avatar James Bottomley

scsi_scan: fix queue depth initialisation problem

Currently we blindly use the value of cmd_per_lun as the initial setting for
queue_depth.  This fails miserably (hangs the system) if it is zero, which is
the default value for anything uninitialised in the template.  The net result
is that every host template has to set a value for cmd_per_lun.  Instead, use
a default value of 1 if the actual value is unset.  This should pave the way
for removing cmd_per_lun from all the templates and eventually from SCSI
itself.
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 32505876
...@@ -280,7 +280,8 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, ...@@ -280,7 +280,8 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
sdev->host->cmd_per_lun, shost->bqt, sdev->host->cmd_per_lun, shost->bqt,
shost->hostt->tag_alloc_policy); shost->hostt->tag_alloc_policy);
} }
scsi_change_queue_depth(sdev, sdev->host->cmd_per_lun); scsi_change_queue_depth(sdev, sdev->host->cmd_per_lun ?
sdev->host->cmd_per_lun : 1);
scsi_sysfs_device_initialize(sdev); scsi_sysfs_device_initialize(sdev);
......
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