Skip to content

Commit 1278dd6

Browse files
axboeJames Bottomley
authored andcommitted
scsi: fix host max depth checking for the 'queue_depth' sysfs interface
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: stable@vger.kernel.org Fixes: 1e6f241 "scsi: don't allow setting of queue_depth bigger than can_queue" Signed-off-by: Jens Axboe <axboe@fb.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
1 parent e7ac6c6 commit 1278dd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/scsi_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ sdev_store_queue_depth(struct device *dev, struct device_attribute *attr,
859859

860860
depth = simple_strtoul(buf, NULL, 0);
861861

862-
if (depth < 1 || depth > sht->can_queue)
862+
if (depth < 1 || depth > sdev->host->can_queue)
863863
return -EINVAL;
864864

865865
retval = sht->change_queue_depth(sdev, depth);

0 commit comments

Comments
 (0)