[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/16] scsi: fix sense code for EREMOTEIO
From: |
Paolo Bonzini |
Subject: |
[PULL 14/16] scsi: fix sense code for EREMOTEIO |
Date: |
Tue, 16 Mar 2021 17:15:29 -0400 |
SENSE_CODE(LUN_COMM_FAILURE) has an ABORTED COMMAND sense key,
so it results in a retry in Linux. To ensure that EREMOTEIO
is forwarded to the guest, use a HARDWARE ERROR sense key
instead. Note that the code before commit d7a84021d was incorrect
because it used HARDWARE_ERROR as a SCSI status, not as a sense
key.
Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scsi/utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scsi/utils.c b/scsi/utils.c
index 873e05aeaf..357b036671 100644
--- a/scsi/utils.c
+++ b/scsi/utils.c
@@ -589,7 +589,7 @@ int scsi_sense_from_errno(int errno_value, SCSISense *sense)
return TASK_SET_FULL;
#ifdef CONFIG_LINUX
/* These errno mapping are specific to Linux. For more information:
- * - scsi_decide_disposition in drivers/scsi/scsi_error.c
+ * - scsi_check_sense and scsi_decide_disposition in
drivers/scsi/scsi_error.c
* - scsi_result_to_blk_status in drivers/scsi/scsi_lib.c
* - blk_errors[] in block/blk-core.c
*/
@@ -599,7 +599,7 @@ int scsi_sense_from_errno(int errno_value, SCSISense *sense)
*sense = SENSE_CODE(READ_ERROR);
return CHECK_CONDITION;
case EREMOTEIO:
- *sense = SENSE_CODE(LUN_COMM_FAILURE);
+ *sense = SENSE_CODE(TARGET_FAILURE);
return CHECK_CONDITION;
#endif
case ENOMEDIUM:
--
2.26.2
- [PULL 03/16] MAINTAINERS: Cover fuzzer reproducer tests within 'Device Fuzzing', (continued)
- [PULL 03/16] MAINTAINERS: Cover fuzzer reproducer tests within 'Device Fuzzing', Paolo Bonzini, 2021/03/16
- [PULL 04/16] fuzz: fix the pro100 generic-fuzzer config, Paolo Bonzini, 2021/03/16
- [PULL 06/16] fuzz: add a script to build reproducers, Paolo Bonzini, 2021/03/16
- [PULL 05/16] fuzz: don't leave orphan llvm-symbolizers around, Paolo Bonzini, 2021/03/16
- [PULL 09/16] memory: add a sparse memory device for fuzzing, Paolo Bonzini, 2021/03/16
- [PULL 08/16] fuzz: add a am53c974 generic-fuzzer config, Paolo Bonzini, 2021/03/16
- [PULL 10/16] fuzz: configure a sparse-mem device, by default, Paolo Bonzini, 2021/03/16
- [PULL 13/16] Revert "accel: kvm: Add aligment assert for kvm_log_clear_one_slot", Paolo Bonzini, 2021/03/16
- [PULL 12/16] configure: add option to explicitly enable/disable libgio, Paolo Bonzini, 2021/03/16
- [PULL 11/16] fuzz: move some DMA hooks, Paolo Bonzini, 2021/03/16
- [PULL 14/16] scsi: fix sense code for EREMOTEIO,
Paolo Bonzini <=
- [PULL 15/16] hw/i8254: fix vmstate load, Paolo Bonzini, 2021/03/16
- [PULL 16/16] qemu-timer: allow freeing a NULL timer, Paolo Bonzini, 2021/03/16
- Re: [PULL 00/16] Fuzzing + bugfix patches for QEMU 6.0 soft freeze, Peter Maydell, 2021/03/18