From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:35235 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2992820AbbHHUhw (ORCPT ); Sat, 8 Aug 2015 16:37:52 -0400 Subject: Patch "scsi: fix host max depth checking for the 'queue_depth' sysfs interface" has been added to the 4.1-stable tree To: axboe@fb.com, JBottomley@Odin.com, gregkh@linuxfoundation.org, hch@lst.de, martin.petersen@oracle.com Cc: , From: Date: Sat, 08 Aug 2015 13:37:50 -0700 Message-ID: <1439066270843@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled scsi: fix host max depth checking for the 'queue_depth' sysfs interface to the 4.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: scsi-fix-host-max-depth-checking-for-the-queue_depth-sysfs-interface.patch and it can be found in the queue-4.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 1278dd6809b11dc298e19d81ac0916275f7318c1 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 13 Jul 2015 08:24:39 -0600 Subject: scsi: fix host max depth checking for the 'queue_depth' sysfs interface From: Jens Axboe 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 Reviewed-by: Martin K. Petersen Reviewed-by: Christoph Hellwig Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/scsi_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -859,7 +859,7 @@ sdev_store_queue_depth(struct device *de 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); Patches currently in stable-queue which might be from axboe@fb.com are queue-4.1/bio-integrity-do-not-assume-bio_integrity_pool-exists-if-bioset-exists.patch queue-4.1/scsi-fix-host-max-depth-checking-for-the-queue_depth-sysfs-interface.patch