Skip to content

Commit

Permalink
scsi: fix host max depth checking for the 'queue_depth' sysfs interface
Browse files Browse the repository at this point in the history
Commit 1e6f241 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: [email protected]
Fixes: 1e6f241 "scsi: don't allow setting of queue_depth bigger than can_queue"
Signed-off-by: Jens Axboe <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
axboe authored and James Bottomley committed Jul 16, 2015
1 parent e7ac6c6 commit 1278dd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/scsi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1278dd6

Please sign in to comment.