On 6/4/22 19:13, michael.christie@xxxxxxxxxx wrote:
On 6/4/22 2:38 AM, Hannes Reinecke wrote:
On 6/3/22 21:45, Keith Busch wrote:
On Fri, Jun 03, 2022 at 01:55:34AM -0500, Mike Christie wrote:
@@ -171,6 +171,7 @@ static const struct {
/* zone device specific errors */
[BLK_STS_ZONE_OPEN_RESOURCE] = { -ETOOMANYREFS, "open zones exceeded" },
[BLK_STS_ZONE_ACTIVE_RESOURCE] = { -EOVERFLOW, "active zones exceeded" },
+ [BLK_STS_RSV_CONFLICT] = { -EBADE, "resevation conflict" },
You misspelled "reservation". :)
And since you want a different error, why reuse EBADE for the errno? That is
already used for BLK_STS_NEXUS that you're trying to differentiate from, right?
At least for nvme, this error code is returned when the host lacks sufficient
rights, so something like EACCESS might make sense.
Looks good otherwise.
Welll ... BLK_STS_NEXUS _is_ the reservation error.
I was not sure of xen/virtio scsi uses of BLK_STS_NEXUS/DID_NEXUS_FAILURE.
The virtio spec's description for VIRTIO_SCSI_S_NEXUS_FAILURE:
if the nexus is suffering a failure but retrying on other paths might
yield a different result.
looks like the description for DID_NEXUS_FAILURE in scsi_status.h.
To me the the description sounded generic where it could used for
other errors like the endpoint/port for the I_T is removed.
However, the qemu code only uses VIRTIO_SCSI_S_NEXUS_FAILURE for
reservation conflicts. If we are saying that is always the case in
other virt implementations, I don't even need this patch :) and we
can do what you requested and do more of a rename.
Well ... we tried to find a generic error for reservation failure, as we
thought that reservation failure was too SCSI specific.
And we wanted the error to describe what the resulting handling should
be, not what the cause was. Hence we ended up with BLK_STS_NEXUS.
But turns out that our initial assumption wasn't valid, and that
reservations are a general concept. So by all means, rename
BLK_STS_NEXUS to BLK_STS_RSV_CONFLICT to make it clear what this error
is about.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@xxxxxxx +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman