On 01/07/19 12:14, Shinichiro Kawasaki wrote: > I observe four of them listed below in sense data, > when I ran basic operations to the zoned storage from the guest via > scsi-block. > > 21h 04h: UNALIGNED WRITE COMMAND > 21h 05h: WRITE BOUNDARY VIOLATION > 21h 06h: ATTEMPT TO READ INVALID DATA > 55h 0Eh: INSUFFICIENT ZONE RESOURCES > > These ASCs can be reported for write or read commands due to unexpected zone > status or write pointer status. Reporting these ASCs to the guest, the user > applications can handle them to manage zone/write pointer status, or help the > user application developers to understand the failure reason and fix bugs. > > I took a look in scsi_sense_to_errno() and learned that ASCs are grouped in > errnos. To report the ASCs above to the guest, is it good to add them in > EINVAL > group defined in scsi_sense_to_errno()? The ASCs are reported with sense key > ILLEGAL_REQUEST or DATA_PROTECT, then I think it fits in the function.
The grouping by errno is historical and pretty much broken. It should be possible to change it to return just a bool. Paolo