On 4/22/21 12:26 AM, Bart Van Assche wrote:
On 4/21/21 10:47 AM, Hannes Reinecke wrote:
My plan here is move every driver to use accessors for the
remaining bytes in the SCSI result, and with that move the
SCSI result over into two separate values.
This patch series modifies scsi_execute() such that it either returns a
negative Unix error code or a positive SCSI status value that includes
the host byte and status byte. I think that a union is a good way to
model such return values. I'd like to use something similar to the
scsi_status union from my patch series to model such return values. I
think that union is also appropriate as a replacement for the 'result'
member of struct scsi_cmnd.
And that was precisely the point of my patchset: do _not_ use driver
byte nor message byte in the SCSI midlayer.
So the midlayer can be reduced to handling just the host byte and the
status byte. Whether this is by means of a union or something else
doesn't really matter; this patchset doesn't prevent any of this from
happening.
I'm open to discussion on whether we need to expose the original driver
byte to userspace; I've already attempted to do this for DRIVER_SENSE,
and if needs be DRIVER_ERROR can be fudged in, too.
But I do think that message byte handling should be killed from the
midlayer, as it really is SCSI parallel specific and shouldn't be
exposed to the midlayer at all.
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: Felix Imendörffer