Return-Path: Received: from mail.sevenbyte.org ([5.9.90.188]:35516 "EHLO mail.sevenbyte.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753601AbbG0MpP (ORCPT ); Mon, 27 Jul 2015 08:45:15 -0400 From: Stefan Tatschner To: ludwig.kuerzinger@aisec.fraunhofer.de Cc: Jens Axboe , stable@vger.kernel.org, James Bottomley Subject: [PATCH 5/9] scsi: fix host max depth checking for the 'queue_depth' sysfs interface Date: Mon, 27 Jul 2015 14:26:23 +0200 Message-Id: <1437999987-24879-5-git-send-email-stefan@sevenbyte.org> In-Reply-To: <1437999987-24879-1-git-send-email-stefan@sevenbyte.org> References: <1437999987-24879-1-git-send-email-stefan@sevenbyte.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.4.6" Sender: stable-owner@vger.kernel.org List-ID: From: Jens Axboe This is a multi-part message in MIME format. --------------2.4.6 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit 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@vger.kernel.org Fixes: 1e6f2416044c0 "scsi: don't allow setting of queue_depth bigger than can_queue" Signed-off-by: Jens Axboe Reviewed-by: Martin K. Petersen Reviewed-by: Christoph Hellwig Signed-off-by: James Bottomley --- drivers/scsi/scsi_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --------------2.4.6 Content-Type: text/x-patch; name="0005-scsi-fix-host-max-depth-checking-for-the-queue_depth.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0005-scsi-fix-host-max-depth-checking-for-the-queue_depth.patch" diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 1ac38e7..9ad4116 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.6--