]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2016 20:06:41 +0000 (13:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2016 20:06:41 +0000 (13:06 -0700)
added patches:
scsi-add-qemu-cd-rom-to-vpd-inquiry-blacklist.patch
scsi_lib-correctly-retry-failed-zero-length-req_type_fs-commands.patch

queue-4.6/scsi-add-qemu-cd-rom-to-vpd-inquiry-blacklist.patch [new file with mode: 0644]
queue-4.6/scsi_lib-correctly-retry-failed-zero-length-req_type_fs-commands.patch [new file with mode: 0644]

diff --git a/queue-4.6/scsi-add-qemu-cd-rom-to-vpd-inquiry-blacklist.patch b/queue-4.6/scsi-add-qemu-cd-rom-to-vpd-inquiry-blacklist.patch
new file mode 100644 (file)
index 0000000..4f90414
--- /dev/null
@@ -0,0 +1,54 @@
+From fbd83006e3e536fcb103228d2422ea63129ccb03 Mon Sep 17 00:00:00 2001
+From: "Ewan D. Milne" <emilne@redhat.com>
+Date: Tue, 31 May 2016 09:42:29 -0400
+Subject: scsi: Add QEMU CD-ROM to VPD Inquiry Blacklist
+
+From: Ewan D. Milne <emilne@redhat.com>
+
+commit fbd83006e3e536fcb103228d2422ea63129ccb03 upstream.
+
+Linux fails to boot as a guest with a QEMU CD-ROM:
+
+[    4.439488] ata2.00: ATAPI: QEMU CD-ROM, 0.8.2, max UDMA/100
+[    4.443649] ata2.00: configured for MWDMA2
+[    4.450267] scsi 1:0:0:0: CD-ROM            QEMU     QEMU CD-ROM      0.8. PQ: 0 ANSI: 5
+[    4.464317] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
+[    4.464319] ata2.00: BMDMA stat 0x5
+[    4.464339] ata2.00: cmd a0/01:00:00:00:01/00:00:00:00:00/a0 tag 0 dma 16640 in
+[    4.464339]          Inquiry 12 01 00 00 ff 00res 48/20:02:00:24:00/00:00:00:00:00/a0 Emask 0x2 (HSM violation)
+[    4.464341] ata2.00: status: { DRDY DRQ }
+[    4.465864] ata2: soft resetting link
+[    4.625971] ata2.00: configured for MWDMA2
+[    4.628290] ata2: EH complete
+[    4.646670] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
+[    4.646671] ata2.00: BMDMA stat 0x5
+[    4.646683] ata2.00: cmd a0/01:00:00:00:01/00:00:00:00:00/a0 tag 0 dma 16640 in
+[    4.646683]          Inquiry 12 01 00 00 ff 00res 48/20:02:00:24:00/00:00:00:00:00/a0 Emask 0x2 (HSM violation)
+[    4.646685] ata2.00: status: { DRDY DRQ }
+[    4.648193] ata2: soft resetting link
+
+...
+
+Fix this by suppressing VPD inquiry for this device.
+
+Signed-off-by: Ewan D. Milne <emilne@redhat.com>
+Reported-by: Jan Stancek <jstancek@redhat.com>
+Tested-by: Jan Stancek <jstancek@redhat.com>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/scsi_devinfo.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/scsi/scsi_devinfo.c
++++ b/drivers/scsi/scsi_devinfo.c
+@@ -230,6 +230,7 @@ static struct {
+       {"PIONEER", "CD-ROM DRM-624X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
+       {"Promise", "VTrak E610f", NULL, BLIST_SPARSELUN | BLIST_NO_RSOC},
+       {"Promise", "", NULL, BLIST_SPARSELUN},
++      {"QEMU", "QEMU CD-ROM", NULL, BLIST_SKIP_VPD_PAGES},
+       {"QNAP", "iSCSI Storage", NULL, BLIST_MAX_1024},
+       {"SYNOLOGY", "iSCSI Storage", NULL, BLIST_MAX_1024},
+       {"QUANTUM", "XP34301", "1071", BLIST_NOTQ},
diff --git a/queue-4.6/scsi_lib-correctly-retry-failed-zero-length-req_type_fs-commands.patch b/queue-4.6/scsi_lib-correctly-retry-failed-zero-length-req_type_fs-commands.patch
new file mode 100644 (file)
index 0000000..db00871
--- /dev/null
@@ -0,0 +1,47 @@
+From a621bac3044ed6f7ec5fa0326491b2d4838bfa93 Mon Sep 17 00:00:00 2001
+From: James Bottomley <James.Bottomley@HansenPartnership.com>
+Date: Fri, 13 May 2016 12:04:06 -0700
+Subject: scsi_lib: correctly retry failed zero length REQ_TYPE_FS commands
+
+From: James Bottomley <James.Bottomley@HansenPartnership.com>
+
+commit a621bac3044ed6f7ec5fa0326491b2d4838bfa93 upstream.
+
+When SCSI was written, all commands coming from the filesystem
+(REQ_TYPE_FS commands) had data.  This meant that our signal for needing
+to complete the command was the number of bytes completed being equal to
+the number of bytes in the request.  Unfortunately, with the advent of
+flush barriers, we can now get zero length REQ_TYPE_FS commands, which
+confuse this logic because they satisfy the condition every time.  This
+means they never get retried even for retryable conditions, like UNIT
+ATTENTION because we complete them early assuming they're done.  Fix
+this by special casing the early completion condition to recognise zero
+length commands with errors and let them drop through to the retry code.
+
+Reported-by: Sebastian Parschauer <s.parschauer@gmx.de>
+Signed-off-by: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
+Tested-by: Jack Wang <jinpu.wang@profitbricks.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/scsi_lib.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/scsi/scsi_lib.c
++++ b/drivers/scsi/scsi_lib.c
+@@ -911,9 +911,12 @@ void scsi_io_completion(struct scsi_cmnd
+       }
+       /*
+-       * If we finished all bytes in the request we are done now.
++       * special case: failed zero length commands always need to
++       * drop down into the retry code. Otherwise, if we finished
++       * all bytes in the request we are done now.
+        */
+-      if (!scsi_end_request(req, error, good_bytes, 0))
++      if (!(blk_rq_bytes(req) == 0 && error) &&
++          !scsi_end_request(req, error, good_bytes, 0))
+               return;
+       /*