All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-11.0] scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable
@ 2026-03-30 12:16 Kevin Wolf
  2026-03-30 13:11 ` Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kevin Wolf @ 2026-03-30 12:16 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, pbonzini, stefanha, gveitmic, bmarzins, fam, qemu-devel

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>
---
 scsi/utils.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scsi/utils.c b/scsi/utils.c
index 545956f4f95..daee90ecf0e 100644
--- a/scsi/utils.c
+++ b/scsi/utils.c
@@ -373,7 +373,6 @@ static bool scsi_sense_is_guest_recoverable(int key, int asc, int ascq)
     case 0x1a00: /* PARAMETER LIST LENGTH ERROR */
     case 0x2000: /* INVALID OPERATION CODE */
     case 0x2400: /* INVALID FIELD IN CDB */
-    case 0x2500: /* LOGICAL UNIT NOT SUPPORTED */
     case 0x2600: /* INVALID FIELD IN PARAMETER LIST */
 
     case 0x2104: /* UNALIGNED WRITE COMMAND */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH for-11.0] scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable
  2026-03-30 12:16 [PATCH for-11.0] scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable Kevin Wolf
@ 2026-03-30 13:11 ` Paolo Bonzini
  2026-03-30 18:18 ` Stefan Hajnoczi
  2026-03-31 21:32 ` Michael Tokarev
  2 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2026-03-30 13:11 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: stefanha, gveitmic, bmarzins, fam, qemu-devel

On 3/30/26 14:16, Kevin Wolf wrote:
> 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.

I think I mostly looked at what codes QEMU generates itself and excluded 
those.  But if LUN_NOT_SUPPORTED happens like that for storage arrays, 
that is the correct thing to do.


> 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>

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

> ---
>   scsi/utils.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/scsi/utils.c b/scsi/utils.c
> index 545956f4f95..daee90ecf0e 100644
> --- a/scsi/utils.c
> +++ b/scsi/utils.c
> @@ -373,7 +373,6 @@ static bool scsi_sense_is_guest_recoverable(int key, int asc, int ascq)
>       case 0x1a00: /* PARAMETER LIST LENGTH ERROR */
>       case 0x2000: /* INVALID OPERATION CODE */
>       case 0x2400: /* INVALID FIELD IN CDB */
> -    case 0x2500: /* LOGICAL UNIT NOT SUPPORTED */
>       case 0x2600: /* INVALID FIELD IN PARAMETER LIST */
>   
>       case 0x2104: /* UNALIGNED WRITE COMMAND */



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH for-11.0] scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable
  2026-03-30 12:16 [PATCH for-11.0] scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable Kevin Wolf
  2026-03-30 13:11 ` Paolo Bonzini
@ 2026-03-30 18:18 ` Stefan Hajnoczi
  2026-03-31 12:28   ` Kevin Wolf
  2026-03-31 21:32 ` Michael Tokarev
  2 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2026-03-30 18:18 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, pbonzini, gveitmic, bmarzins, fam, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1497 bytes --]

On Mon, Mar 30, 2026 at 02:16:35PM +0200, Kevin Wolf wrote:
> 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>
> ---
>  scsi/utils.c | 1 -
>  1 file changed, 1 deletion(-)

Paolo: Are you taking this through your SCSI tree or would you like
Peter to merge it directly?

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH for-11.0] scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable
  2026-03-30 18:18 ` Stefan Hajnoczi
@ 2026-03-31 12:28   ` Kevin Wolf
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2026-03-31 12:28 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-block, pbonzini, gveitmic, bmarzins, fam, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1685 bytes --]

Am 30.03.2026 um 20:18 hat Stefan Hajnoczi geschrieben:
> On Mon, Mar 30, 2026 at 02:16:35PM +0200, Kevin Wolf wrote:
> > 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>
> > ---
> >  scsi/utils.c | 1 -
> >  1 file changed, 1 deletion(-)
> 
> Paolo: Are you taking this through your SCSI tree or would you like
> Peter to merge it directly?

I'll send a PR today anyway, so now that it has the R-b from both of
you, I can take it through the block tree.

Kevin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH for-11.0] scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable
  2026-03-30 12:16 [PATCH for-11.0] scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable Kevin Wolf
  2026-03-30 13:11 ` Paolo Bonzini
  2026-03-30 18:18 ` Stefan Hajnoczi
@ 2026-03-31 21:32 ` Michael Tokarev
  2 siblings, 0 replies; 5+ messages in thread
From: Michael Tokarev @ 2026-03-31 21:32 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block
  Cc: pbonzini, stefanha, gveitmic, bmarzins, fam, qemu-devel,
	qemu-stable

On 30.03.2026 15:16, Kevin Wolf wrote:
> 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>

Ditto for this one, - while not a big deal really, but I'm picking it up
for the current stable series.  Please let me know if I shouldn't.

Thanks,

/mjt


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-31 21:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 12:16 [PATCH for-11.0] scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable Kevin Wolf
2026-03-30 13:11 ` Paolo Bonzini
2026-03-30 18:18 ` Stefan Hajnoczi
2026-03-31 12:28   ` Kevin Wolf
2026-03-31 21:32 ` Michael Tokarev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.