Blame SOURCES/kvm-iscsi-recognize-invalid-field-ASCQ-from-WRITE-SAME-c.patch

240766
From 70ccfb3676918e20a2c83774d0242ad98b1f2f93 Mon Sep 17 00:00:00 2001
240766
From: Fam Zheng <famz@redhat.com>
240766
Date: Fri, 4 Apr 2014 05:56:00 +0200
240766
Subject: [PATCH 05/12] iscsi: recognize "invalid field" ASCQ from WRITE SAME command
240766
240766
RH-Author: Fam Zheng <famz@redhat.com>
240766
Message-id: <1396590962-25815-6-git-send-email-famz@redhat.com>
240766
Patchwork-id: 58342
240766
O-Subject: [RHEL-7 0day qemu-kvm PATCH 5/7] iscsi: recognize "invalid field" ASCQ from WRITE SAME command
240766
Bugzilla: 1090978
240766
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
240766
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
240766
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
240766
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
240766
240766
From: Paolo Bonzini <pbonzini@redhat.com>
240766
240766
Some targets may return "invalid field" as the ASCQ from WRITE SAME
240766
if they support the command only without the UNMAP field.  Recognize
240766
that, and return ENOTSUP just like for "invalid operation code".
240766
240766
Reviewed-by: Peter Lieven <pl@kamp.de>
240766
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
240766
(cherry picked from commit 27898a5daa4c6d28adb32b401a011d7198494482)
240766
Signed-off-by: Fam Zheng <famz@redhat.com>
240766
---
240766
 block/iscsi.c | 3 ++-
240766
 1 file changed, 2 insertions(+), 1 deletion(-)
240766
240766
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
240766
---
240766
 block/iscsi.c |    3 ++-
240766
 1 files changed, 2 insertions(+), 1 deletions(-)
240766
240766
diff --git a/block/iscsi.c b/block/iscsi.c
240766
index 4a535e3..268da2f 100644
240766
--- a/block/iscsi.c
240766
+++ b/block/iscsi.c
240766
@@ -1012,7 +1012,8 @@ retry:
240766
 
240766
     if (iTask.status == SCSI_STATUS_CHECK_CONDITION &&
240766
         iTask.task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST &&
240766
-        iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
240766
+        (iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE ||
240766
+         iTask.task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_FIELD_IN_CDB)) {
240766
         /* WRITE SAME is not supported by the target */
240766
         iscsilun->has_write_same = false;
240766
         scsi_free_scsi_task(iTask.task);
240766
-- 
240766
1.7.1
240766