cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-scsi-disk-fix-bug-in-scsi_block_new_request-introduc.patch

9ae3a8
From 4c3960c0fdeb57a5cb74a9de3883b6e6109bf946 Mon Sep 17 00:00:00 2001
9ae3a8
From: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
Date: Fri, 12 Sep 2014 11:56:30 +0200
9ae3a8
Subject: [PATCH] scsi-disk: fix bug in scsi_block_new_request() introduced by commit 137745c
9ae3a8
9ae3a8
Message-id: <1410522991-11612-1-git-send-email-pbonzini@redhat.com>
9ae3a8
Patchwork-id: 61021
9ae3a8
O-Subject: [RHEL 7.1/7.0.z qemu-kvm PATCH] scsi-disk: fix bug in scsi_block_new_request() introduced by commit 137745c
9ae3a8
Bugzilla: 1105880
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Fam Zheng <famz@redhat.com>
9ae3a8
9ae3a8
From: Ulrich Obergfell <uobergfe@redhat.com>
9ae3a8
9ae3a8
This patch fixes a bug in scsi_block_new_request() that was introduced
9ae3a8
by commit 137745c5c60f083ec982fe9e861e8c16ebca1ba8. If the host cache
9ae3a8
is used - i.e. if BDRV_O_NOCACHE is _not_ set - the 'break' statement
9ae3a8
needs to be executed to 'fall back' to SG_IO.
9ae3a8
9ae3a8
Cc: qemu-stable@nongnu.org
9ae3a8
Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
9ae3a8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
(cherry picked from commit 2fe5a9f73b3446690db2cae8a58473b0b4beaa32)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/scsi/scsi-disk.c |    2 +-
9ae3a8
 1 files changed, 1 insertions(+), 1 deletions(-)
9ae3a8
9ae3a8
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
9ae3a8
index 1d41db2..50b7910 100644
9ae3a8
--- a/hw/scsi/scsi-disk.c
9ae3a8
+++ b/hw/scsi/scsi-disk.c
9ae3a8
@@ -2502,7 +2502,7 @@ static SCSIRequest *scsi_block_new_request(SCSIDevice *d, uint32_t tag,
9ae3a8
 	 * ones (such as WRITE SAME or EXTENDED COPY, etc.).  So, without
9ae3a8
 	 * O_DIRECT everything must go through SG_IO.
9ae3a8
          */
9ae3a8
-        if (bdrv_get_flags(s->qdev.conf.bs) & BDRV_O_NOCACHE) {
9ae3a8
+        if (!(bdrv_get_flags(s->qdev.conf.bs) & BDRV_O_NOCACHE)) {
9ae3a8
             break;
9ae3a8
         }
9ae3a8
 
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8