thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
958e1b
From 8ba513a1fa324d87a412705d2ded64e2154e1f2a 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
958e1b
Bugzilla: 1083413
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