[SCSI] Don't attempt to send extended INQUIRY command if skip_vpd_pages is set
authorMartin K. Petersen <martin.petersen@oracle.com>
Wed, 31 Jul 2013 02:58:34 +0000 (22:58 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 2 Aug 2013 20:20:21 +0000 (13:20 -0700)
If a device has the skip_vpd_pages flag set we should simply fail the
scsi_get_vpd_page() call.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Stuart Foster <smf.linux@ntlworld.com>
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi.c

index 3b1ea34..eaa808e 100644 (file)
@@ -1031,6 +1031,9 @@ int scsi_get_vpd_page(struct scsi_device *sdev, u8 page, unsigned char *buf,
 {
        int i, result;
 
+       if (sdev->skip_vpd_pages)
+               goto fail;
+
        /* Ask for all the pages supported by this device */
        result = scsi_vpd_inquiry(sdev, buf, 0, buf_len);
        if (result)