All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Oliver Neukum <oneukum@suse.com>,
	jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com,
	jasowang@redhat.com, mst@redhat.com, stefanha@redhat.com,
	manoj@linux.ibm.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	james.bottomley@hansenpartnership.com
Subject: Re: [PATCH 00/10] scsi: Fix internal host code use
Date: Thu, 4 Aug 2022 12:04:07 -0500	[thread overview]
Message-ID: <1136e369-49b0-c3ef-340a-ab337f514fc5@oracle.com> (raw)
In-Reply-To: <cb0b6190-558d-745a-9342-d7d3eadc680c@suse.com>

On 8/4/22 1:55 AM, Oliver Neukum wrote:
> 
> 
> On 04.08.22 05:40, Mike Christie wrote:
>> The following patches made over Martin's 5.20 staging branch fix an issue
>> where we probably intended the host codes:
>>
>> DID_TARGET_FAILURE
>> DID_NEXUS_FAILURE
>> DID_ALLOC_FAILURE
>> DID_MEDIUM_ERROR
>>
>> to be internal to scsi-ml, but at some point drivers started using them
>> and the driver writers never updated scsi-ml.
> 
> Hi,
> 
> this approach drops useful information, though. If a device
> reports such specific an error condition, why not use that
> information

Is there a specific patch/case/code you are concerned?

I think in most cases the drivers were not using the correct
error code or they were stretching in trying to find a code
already.

The only ones that I thought were questionable were:

1. storvsc_drv: Used DID_TARGET_FAILURE for a local allocation
failure when they wanted to handle lun removal/scanning from a
worker thread.

I don't think DID_TARGET_FAILURE is right here. The driver wants
to just not retry this command. It's not really a perm target
failure like DID_TARGET_FAILURE is documented as. The failure
is just that the driver can't allocate some mem to perform lun
management.

I think either:

1. When we hit that failure path that we want to keep the 
DID_NO_CONNECT/DID_REQUEUE and not overwrite them.

Or

2. I used DID_BAD_TARGET to try and keep the spirit of their
DID_TARGET_FAILURE use where we couldn't handle an operation on
it's behalf. So the target itself is not bad but our processing
for it was so I thought it was close enough.

Note that I think the root issue is that the driver should
not be handling UAs and doing LUN scanning/removal and should
have added code to scsi-ml so it can be handled for everyone.
So really that code should not exist but that is a larger
change. I didn't want to add a new error code because of this.

2. uas: Used DID_TARGET_FAILURE when a TMF was not supported.
Again I don't think that code was right because it's not
a perm target failure. It is something that we don't want to
retry on another path but I don't think that comes up for
this driver ever.

I think DID_BAD_TARGET is ok'ish for this one. It's not a bad
target, but the target doesn't support what we needed and
DID_BAD_TARGET still conveys what we wanted and gives us the
same behavior.

3. cxlflash: DID_ALLOC_FAILURE was wrong in this case because
they wanted a retryable error. DID_ALLOC_FAILURE was for when
we are doing provisioning and couldn't allocate space on the
device, and is not retrable.

DID_ERROR gives them the behavior they want. It does lose info
but that's just how drivers ask scsi-ml to retry errors we don't
have codes for. We could add a new code but I don't think it
was worth it since we don't do that for every other driver and
their retryable errors. If there are drivers that have the same
issue then I'm for adding a new code.




      reply	other threads:[~2022-08-04 17:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04  3:40 [PATCH 00/10] scsi: Fix internal host code use Mike Christie
2022-08-04  3:40 ` [PATCH 01/10] scsi: xen: Drop use of internal host codes Mike Christie
2022-08-04  6:18   ` Juergen Gross
2022-08-04 16:28     ` Mike Christie
2022-08-04 17:00       ` Juergen Gross
2022-08-04  3:40 ` [PATCH 02/10] scsi: storvsc: Drop DID_TARGET_FAILURE use Mike Christie
2022-08-04  3:40 ` [PATCH 03/10] scsi: uas: " Mike Christie
2022-08-04 18:59   ` Mike Christie
2022-08-04 21:07     ` Hans de Goede
2022-08-04  3:40 ` [PATCH 04/10] scsi: virtio_scsi: " Mike Christie
2022-08-04 18:25   ` Paolo Bonzini
2022-08-09 19:40   ` Michael S. Tsirkin
2022-08-04  3:40 ` [PATCH 05/10] scsi: virtio_scsi: Drop DID_NEXUS_FAILURE use Mike Christie
2022-08-04 18:25   ` Paolo Bonzini
2022-08-09 19:40   ` Michael S. Tsirkin
2022-08-04  3:40 ` [PATCH 06/10] scsi: qla2xxx: Drop DID_TARGET_FAILURE use Mike Christie
2022-08-04  3:40 ` [PATCH 07/10] scsi: cxlflash: Drop DID_ALLOC_FAILURE use Mike Christie
2022-08-04  3:40 ` [PATCH 08/10] scsi: Add error codes for internal scsi-ml use Mike Christie
2022-08-09 20:13   ` Bart Van Assche
2022-08-10  3:18     ` Mike Christie
2022-08-04  3:40 ` [PATCH 09/10] scsi: Convert scsi_decide_disposition to use SCSIML_STAT Mike Christie
2022-08-09 20:14   ` Bart Van Assche
2022-08-04  3:41 ` [PATCH 10/10] scsi: Remove useless host error codes Mike Christie
2022-08-09 20:08   ` Bart Van Assche
2022-08-04  6:55 ` [PATCH 00/10] scsi: Fix internal host code use Oliver Neukum
2022-08-04 17:04   ` Mike Christie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1136e369-49b0-c3ef-340a-ab337f514fc5@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=jasowang@redhat.com \
    --cc=jgross@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=manoj@linux.ibm.com \
    --cc=martin.petersen@oracle.com \
    --cc=mrochs@linux.ibm.com \
    --cc=mst@redhat.com \
    --cc=njavali@marvell.com \
    --cc=oneukum@suse.com \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=ukrishn@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.