linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi_scan: fix queue depth initialisation problem
@ 2015-04-28 21:24 James Bottomley
  2015-04-29  6:48 ` Hannes Reinecke
  2015-05-11  9:08 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: James Bottomley @ 2015-04-28 21:24 UTC (permalink / raw)
  To: linux-scsi; +Cc: Hannes Reinecke

From: James Bottomley <JBottomley@Odin.com>
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.

Signed-off-by: James Bottomley <JBottomley@Odin.com>

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 60aae01..681a59a 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -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);
 



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi_scan: fix queue depth initialisation problem
  2015-04-28 21:24 [PATCH] scsi_scan: fix queue depth initialisation problem James Bottomley
@ 2015-04-29  6:48 ` Hannes Reinecke
  2015-05-11  9:08 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Hannes Reinecke @ 2015-04-29  6:48 UTC (permalink / raw)
  To: James Bottomley, linux-scsi

On 04/28/2015 11:24 PM, James Bottomley wrote:
> From: James Bottomley <JBottomley@Odin.com>
> 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.
> 
> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Tested-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		               zSeries & Storage
hare@suse.de			               +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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi_scan: fix queue depth initialisation problem
  2015-04-28 21:24 [PATCH] scsi_scan: fix queue depth initialisation problem James Bottomley
  2015-04-29  6:48 ` Hannes Reinecke
@ 2015-05-11  9:08 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2015-05-11  9:08 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, Hannes Reinecke

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-11  9:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-28 21:24 [PATCH] scsi_scan: fix queue depth initialisation problem James Bottomley
2015-04-29  6:48 ` Hannes Reinecke
2015-05-11  9:08 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).