@samitouri / QOSamiQemu / commits / ccc613f96c

scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable

When commit bdf9613b introduced scsi_sense_buf_is_guest_recoverable(), it included LOGICAL UNIT NOT SUPPORTED in the list of guest recoverable sense codes. It doesn't really explain how the codes to be in the list were selected. As the LUN doesn't come from the guest, but from the block backend (usually the SCSI device on the host that was opened with host_device, but it could also be the iscsi block driver), there is really no way the guest could influence this. It seems that on some storage arrays, LOGICAL UNIT NOT SUPPORTED can happen during failover operations. When combined with multipath, the request should be retried on another path instead of being reported to the guest, which would offline the filesystem in response. Simply returning false in scsi_sense_buf_is_guest_recoverable() will enable the retry logic in file-posix, and will also make sure that if the error persists, the configured error policy is respected so that the VM can be stopped. Buglink: https://redhat.atlassian.net/browse/RHEL-158212 Fixes: bdf9613b7f87 ('scsi: explicitly list guest-recoverable sense codes') Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20260330121635.49205-1-kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Kevin Wolf committed Mar 30, 2026 at 14:16 UTC ccc613f96c66eb5401185ff6eeba18143892055d
1 file changed -1
scsi/utils.c
-1
@@ -373,7 +373,6 @@ static bool scsi_sense_is_guest_recoverable(int key, int asc, int ascq)
373 case 0x1a00: /* PARAMETER LIST LENGTH ERROR */
374 case 0x2000: /* INVALID OPERATION CODE */
375 case 0x2400: /* INVALID FIELD IN CDB */
376 - case 0x2500: /* LOGICAL UNIT NOT SUPPORTED */
376 case 0x2600: /* INVALID FIELD IN PARAMETER LIST */
377
378 case 0x2104: /* UNALIGNED WRITE COMMAND */