* [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface
@ 2015-07-13 14:24 Jens Axboe
2015-07-14 1:30 ` Martin K. Petersen
2015-07-14 7:13 ` Christoph Hellwig
0 siblings, 2 replies; 8+ messages in thread
From: Jens Axboe @ 2015-07-13 14:24 UTC (permalink / raw)
To: linux-scsi; +Cc: Christoph Hellwig
Commit 1e6f2416044c0 changed the scsi sysfs 'queue_depth' code to
rejects depths higher than the scsi host template setting. But lots
of hosts set this to 1, and update the settings in the scsi host
when the controller/devices probing happens.
This breaks (at least) mpt2sas and mpt3sas runtime setting of queue
depth, returning EINVAL for all settings but '1'. And once it's set to
1, there's no way to go back up.
Cc: stable@kernel.org
Fixes: 1e6f2416044c0 "scsi: don't allow setting of queue_depth bigger than can_queue"
Signed-off-by: Jens Axboe <axboe@fb.com>
---
drivers/scsi/scsi_sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 1ac38e73df7e..9ad41168d26d 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -859,7 +859,7 @@ sdev_store_queue_depth(struct device *dev, struct device_attribute *attr,
depth = simple_strtoul(buf, NULL, 0);
- if (depth < 1 || depth > sht->can_queue)
+ if (depth < 1 || depth > sdev->host->can_queue)
return -EINVAL;
retval = sht->change_queue_depth(sdev, depth);
--
2.4.1.168.g1ea28e1
--
Jens Axboe
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface
2015-07-13 14:24 [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface Jens Axboe
@ 2015-07-14 1:30 ` Martin K. Petersen
2015-07-14 7:13 ` Christoph Hellwig
1 sibling, 0 replies; 8+ messages in thread
From: Martin K. Petersen @ 2015-07-14 1:30 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-scsi, Christoph Hellwig
>>>>> "Jens" == Jens Axboe <axboe@fb.com> writes:
Jens> Commit 1e6f2416044c0 changed the scsi sysfs 'queue_depth' code to
Jens> rejects depths higher than the scsi host template setting. But
Jens> lots of hosts set this to 1, and update the settings in the scsi
Jens> host when the controller/devices probing happens.
Yeah. We can't rely on the template for this.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface
2015-07-13 14:24 [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface Jens Axboe
2015-07-14 1:30 ` Martin K. Petersen
@ 2015-07-14 7:13 ` Christoph Hellwig
2015-07-14 11:22 ` Hannes Reinecke
1 sibling, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2015-07-14 7:13 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-scsi, Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
I wonder if we should start to gradually phase out these tuables in the
host template. It's not really more complicated to set them directly
in the host anyway.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface
2015-07-14 7:13 ` Christoph Hellwig
@ 2015-07-14 11:22 ` Hannes Reinecke
2015-07-14 14:04 ` Jens Axboe
0 siblings, 1 reply; 8+ messages in thread
From: Hannes Reinecke @ 2015-07-14 11:22 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe; +Cc: linux-scsi
On 07/14/2015 09:13 AM, Christoph Hellwig wrote:
> Looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
> I wonder if we should start to gradually phase out these tuables in the
> host template. It's not really more complicated to set them directly
> in the host anyway.
Fully agreed. I would vote for making the host template read-only
and modify all drivers to use the shost setting.
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] 8+ messages in thread
* Re: [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface
2015-07-14 11:22 ` Hannes Reinecke
@ 2015-07-14 14:04 ` Jens Axboe
2015-07-14 14:14 ` Hannes Reinecke
2015-07-14 14:20 ` Martin K. Petersen
0 siblings, 2 replies; 8+ messages in thread
From: Jens Axboe @ 2015-07-14 14:04 UTC (permalink / raw)
To: Hannes Reinecke, Christoph Hellwig; +Cc: linux-scsi
On 07/14/2015 05:22 AM, Hannes Reinecke wrote:
> On 07/14/2015 09:13 AM, Christoph Hellwig wrote:
>> Looks good:
>>
>> Reviewed-by: Christoph Hellwig <hch@lst.de>
>>
>> I wonder if we should start to gradually phase out these tuables in the
>> host template. It's not really more complicated to set them directly
>> in the host anyway.
>
> Fully agreed. I would vote for making the host template read-only
> and modify all drivers to use the shost setting.
Indeed, that would be a much saner choice. The settings in a
(effectively already) read-only host template seems like somewhat of a
relic.
--
Jens Axboe
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface
2015-07-14 14:04 ` Jens Axboe
@ 2015-07-14 14:14 ` Hannes Reinecke
2015-07-14 14:20 ` Martin K. Petersen
1 sibling, 0 replies; 8+ messages in thread
From: Hannes Reinecke @ 2015-07-14 14:14 UTC (permalink / raw)
To: Jens Axboe, Christoph Hellwig; +Cc: linux-scsi
On 07/14/2015 04:04 PM, Jens Axboe wrote:
> On 07/14/2015 05:22 AM, Hannes Reinecke wrote:
>> On 07/14/2015 09:13 AM, Christoph Hellwig wrote:
>>> Looks good:
>>>
>>> Reviewed-by: Christoph Hellwig <hch@lst.de>
>>>
>>> I wonder if we should start to gradually phase out these tuables
>>> in the
>>> host template. It's not really more complicated to set them
>>> directly
>>> in the host anyway.
>>
>> Fully agreed. I would vote for making the host template read-only
>> and modify all drivers to use the shost setting.
>
> Indeed, that would be a much saner choice. The settings in a
> (effectively already) read-only host template seems like somewhat of
> a relic.
>
Plus some drivers have the habit of modifying the template based on
the settings _for this particular_ device, which leads to
interesting results if you have several devices with _different_
settings ...
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] 8+ messages in thread
* Re: [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface
2015-07-14 14:04 ` Jens Axboe
2015-07-14 14:14 ` Hannes Reinecke
@ 2015-07-14 14:20 ` Martin K. Petersen
2015-07-14 14:32 ` Hannes Reinecke
1 sibling, 1 reply; 8+ messages in thread
From: Martin K. Petersen @ 2015-07-14 14:20 UTC (permalink / raw)
To: Jens Axboe; +Cc: Hannes Reinecke, Christoph Hellwig, linux-scsi
>>>>> "Jens" == Jens Axboe <axboe@fb.com> writes:
>> Fully agreed. I would vote for making the host template read-only and
>> modify all drivers to use the shost setting.
Jens> Indeed, that would be a much saner choice. The settings in a
Jens> (effectively already) read-only host template seems like somewhat
Jens> of a relic.
Agree 100%.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface
2015-07-14 14:20 ` Martin K. Petersen
@ 2015-07-14 14:32 ` Hannes Reinecke
0 siblings, 0 replies; 8+ messages in thread
From: Hannes Reinecke @ 2015-07-14 14:32 UTC (permalink / raw)
To: Martin K. Petersen, Jens Axboe; +Cc: Christoph Hellwig, linux-scsi
On 07/14/2015 04:20 PM, Martin K. Petersen wrote:
>>>>>> "Jens" == Jens Axboe <axboe@fb.com> writes:
>
>>> Fully agreed. I would vote for making the host template read-only and
>>> modify all drivers to use the shost setting.
>
> Jens> Indeed, that would be a much saner choice. The settings in a
> Jens> (effectively already) read-only host template seems like somewhat
> Jens> of a relic.
>
> Agree 100%.
>
While we're at it: why is the 'cmd_pool' attached to the host
template? Do all hosts with the same driver share a common pool?
(I sincerely do hope not ...)
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] 8+ messages in thread
end of thread, other threads:[~2015-07-14 14:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-13 14:24 [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface Jens Axboe
2015-07-14 1:30 ` Martin K. Petersen
2015-07-14 7:13 ` Christoph Hellwig
2015-07-14 11:22 ` Hannes Reinecke
2015-07-14 14:04 ` Jens Axboe
2015-07-14 14:14 ` Hannes Reinecke
2015-07-14 14:20 ` Martin K. Petersen
2015-07-14 14:32 ` Hannes Reinecke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox