]> git.ipfire.org Git - thirdparty/qemu.git/commit
scsi-block: Don't skip callback for sgio error status/driver_status
authorKevin Wolf <kwolf@redhat.com>
Wed, 31 Jul 2024 12:32:05 +0000 (14:32 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 10 Apr 2025 13:26:40 +0000 (16:26 +0300)
commitf4c342a0797e119478ff3a583d75c2f0fe782399
tree4dcdc09e0a33cd2f53ed5d6998c58a69f3b9611e
parentfc2b3245692eb54a626ead17d47cc43942069673
scsi-block: Don't skip callback for sgio error status/driver_status

Instead of calling into scsi_handle_rw_error() directly from
scsi_block_sgio_complete() and skipping the normal callback, go through
the normal cleanup path by calling the callback with a positive error
value.

The important difference here is not only that the code path is cleaner,
but that the callbacks set r->req.aiocb = NULL. If we skip setting this
and the error action is BLOCK_ERROR_ACTION_STOP, resuming the VM runs
into an assertion failure in scsi_read_data() or scsi_write_data()
because the dangling aiocb pointer is unexpected.

Fixes: a108557bbf ("scsi: inline sg_io_sense_from_errno() into the callers.")
Buglink: https://issues.redhat.com/browse/RHEL-50000
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20240731123207.27636-3-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 622a70161ac258e4a166a7dca4b5be267e0652d9)
(Mjt: also remove locking code which has been removed by
 v8.2.0-126-g1404226804 "scsi: don't lock AioContext in I/O code path")
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/scsi/scsi-disk.c