scsi_scan: fix queue depth initialisation problem
James Bottomley
maintainerPATCH 1/1 scsi_scan: fix queue depth initialisation problem
From: James Bottomley <[email protected]>
Date: Sun, 26 Apr 2015 11:52:46 -0700
Subject: [PATCH] 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.
drivers/scsi/scsi_scan.c +2 -1
@@ -280,7 +280,8 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, sdev->host->cmd_per_lun, shost->bqt, 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);
Quoted 12 lines · James Bottomley
From: James Bottomley <[email protected]>
Date: Sun, 26 Apr 2015 11:52:46 -0700
Subject: [PATCH]scsi_scan: fix queue depth initialisation problemCurrently we blindly use the value of
cmd_per_lunas the initial setting forqueue_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 forcmd_per_lun. Instead, use a default value of 1 if the actual value is unset. This should pave the way for removingcmd_per_lunfrom all the templates and eventually from SCSI itself.
Quoted 1 line
Signed-off-by James Bottomley <[email protected]>
Cheers,
Hannes
Signature · 9 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Looks good,