stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "scsi: core: scsi_get_device_flags_keyed(): Always return device flags" has been added to the 4.4-stable tree
@ 2018-03-19  9:09 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-03-19  9:09 UTC (permalink / raw)
  To: bart.vanassche, alexander.levin, gregkh, hare, hch, jthumshirn,
	martin.petersen
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    scsi: core: scsi_get_device_flags_keyed(): Always return device flags

to the 4.4-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-core-scsi_get_device_flags_keyed-always-return-device-flags.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Mon Mar 19 09:58:12 CET 2018
From: Bart Van Assche <bart.vanassche@wdc.com>
Date: Mon, 4 Dec 2017 10:36:31 -0800
Subject: scsi: core: scsi_get_device_flags_keyed(): Always return device flags

From: Bart Van Assche <bart.vanassche@wdc.com>


[ Upstream commit a44c9d36509c83cf64f33b93f6ab2e63822c01eb ]

Since scsi_get_device_flags_keyed() callers do not check whether or not
the returned value is an error code, change that function such that it
returns a flags value even if the 'key' argument is invalid.  Note:
since commit 28a0bc4120d3 ("scsi: sd: Implement blacklist option for
WRITE SAME w/ UNMAP") bit 31 is a valid device information flag so
checking whether bit 31 is set in the return value is not sufficient to
tell the difference between an error code and a flags value.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/scsi/scsi_devinfo.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -589,17 +589,12 @@ int scsi_get_device_flags_keyed(struct s
 				int key)
 {
 	struct scsi_dev_info_list *devinfo;
-	int err;
 
 	devinfo = scsi_dev_info_list_find(vendor, model, key);
 	if (!IS_ERR(devinfo))
 		return devinfo->flags;
 
-	err = PTR_ERR(devinfo);
-	if (err != -ENOENT)
-		return err;
-
-	/* nothing found, return nothing */
+	/* key or device not found: return nothing */
 	if (key != SCSI_DEVINFO_GLOBAL)
 		return 0;
 


Patches currently in stable-queue which might be from bart.vanassche@wdc.com are

queue-4.4/scsi-core-scsi_get_device_flags_keyed-always-return-device-flags.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-19  9:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19  9:09 Patch "scsi: core: scsi_get_device_flags_keyed(): Always return device flags" has been added to the 4.4-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).