From c2608fba2c91771884708de62d52589652afe9e5db7d4cd0bb6d2659b17fde4c Mon Sep 17 00:00:00 2001 From: Dario Faggioli Date: Fri, 25 Mar 2022 17:52:29 +0000 Subject: [PATCH] Accepting request 964919 from home:dfaggioli:devel:Virtualization - Add missing patch from a PTFs (bsc#1194938, P2 bug!) * Patches added: scsi-generic-check-for-additional-SG_IO-.patch OBS-URL: https://build.opensuse.org/request/show/964919 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=699 --- bundles.tar.xz | 4 +-- qemu.changes | 7 ++++ qemu.spec | 2 ++ ...-generic-check-for-additional-SG_IO-.patch | 36 +++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 scsi-generic-check-for-additional-SG_IO-.patch diff --git a/bundles.tar.xz b/bundles.tar.xz index 5134c85a..e1729be4 100644 --- a/bundles.tar.xz +++ b/bundles.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9891379f129dd699bb0ad0b1a9de1c5d6464fec478ca5e597a3461cd6e2b4b1f -size 88208 +oid sha256:5f4a8d7f2f09d3aa230e21e5c02290085428420b66c277a96e8db820e6246566 +size 88892 diff --git a/qemu.changes b/qemu.changes index 38315044..ae0005fc 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Mar 25 17:44:06 UTC 2022 - Dario Faggioli + +- Add missing patch from a PTFs (bsc#1194938) +* Patches added: + scsi-generic-check-for-additional-SG_IO-.patch + ------------------------------------------------------------------- Thu Mar 24 11:18:54 UTC 2022 - Li Zhang diff --git a/qemu.spec b/qemu.spec index 566e9bfe..25f3ac6e 100644 --- a/qemu.spec +++ b/qemu.spec @@ -221,6 +221,7 @@ Patch00074: tools-virtiofsd-Add-rseq-syscall-to-the-.patch Patch00075: tests-qemu-iotests-040-Skip-TestCommitWi.patch Patch00076: tests-qemu-iotests-testrunner-Quote-case.patch Patch00077: Fix-the-module-building-problem-for-s390.patch +Patch00078: scsi-generic-check-for-additional-SG_IO-.patch # Patches applied in roms/seabios/: Patch01000: seabios-use-python2-explicitly-as-needed.patch Patch01001: seabios-switch-to-python3-as-needed.patch @@ -1221,6 +1222,7 @@ This package records qemu testsuite results and represents successful testing. %patch00075 -p1 %patch00076 -p1 %patch00077 -p1 +%patch00078 -p1 %patch01000 -p1 %patch01001 -p1 %patch01002 -p1 diff --git a/scsi-generic-check-for-additional-SG_IO-.patch b/scsi-generic-check-for-additional-SG_IO-.patch new file mode 100644 index 00000000..7ce294ff --- /dev/null +++ b/scsi-generic-check-for-additional-SG_IO-.patch @@ -0,0 +1,36 @@ +From: Hannes Reinecke +Date: Fri, 25 Mar 2022 18:41:52 +0100 +Subject: scsi-generic: check for additional SG_IO status on completion + +References: bsc#1178049 + +SG_IO may return additional status in the 'status', 'driver_status', +and 'host_status' fields. When either of these fields are set the +command has not been executed normally, so we should not continue +processing this command but rather return an error. +scsi_read_complete() already checks for these errors, +scsi_write_complete() does not. + +Signed-off-by: Hannes Reinecke +Signed-off-by: Lin Ma +Signed-off-by: Dario Faggioli +--- + hw/scsi/scsi-generic.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c +index 343b51c2c0ab5dc7fb792aeb6458..513b10bed0f4279dc4077a31c66f 100644 +--- a/hw/scsi/scsi-generic.c ++++ b/hw/scsi/scsi-generic.c +@@ -391,7 +391,10 @@ static void scsi_write_complete(void * opaque, int ret) + + aio_context_acquire(blk_get_aio_context(s->conf.blk)); + +- if (ret || r->req.io_canceled) { ++ if (ret || r->req.io_canceled || ++ r->io_header.status != SCSI_HOST_OK || ++ (r->io_header.driver_status & SG_ERR_DRIVER_TIMEOUT) || ++ r->io_header.status != GOOD) { + scsi_command_complete_noio(r, ret); + goto done; + }