scsi: fix host max depth checking for the 'queue_depth' sysfs interface
authorJens Axboe <axboe@fb.com>
Mon, 13 Jul 2015 14:24:39 +0000 (08:24 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Aug 2015 19:21:54 +0000 (12:21 -0700)
commita77aa615ba7c4d7511993ecf4278bd604da49991
tree680d964a7f94457a4e922044f5ecbefedc70a74d
parentdc59806d397a10f8a7c838f3de4fe0185d4299a3
scsi: fix host max depth checking for the 'queue_depth' sysfs interface

commit 1278dd6809b11dc298e19d81ac0916275f7318c1 upstream.

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.

Fixes: 1e6f2416044c0 "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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/scsi_sysfs.c