Re: [PATCH v6 3/3] scsi: bsg: add io_uring passthrough handler
From: Bart Van Assche
Date: Thu Mar 05 2026 - 10:51:12 EST
On 3/4/26 7:28 PM, Yang Xiuwei wrote:
+ u8 device_status; /* SCSI device status (low 8 bits of result) */
+ u8 driver_status; /* SCSI driver status (DRIVER_SENSE if check) */
+ u8 host_status; /* SCSI host status (host_byte of result) */
Why separate members for device_status, driver_status and host_status instead of storing the SCSI result (scsi_cmnd.result)?
+ /* Build res2 with status information */
+ res2 = ((u64)pdu->resid_len << 32) |
+ ((u64)(pdu->scsi.sense_len_wr & 0xff) << 24) |
+ ((u64)(pdu->scsi.host_status & 0xff) << 16) |
+ ((u64)(pdu->scsi.driver_status & 0xff) << 8) |
+ (pdu->scsi.device_status & 0xff);
Please remove the superfluous " & 0xff" from u8 expressions.
+ pdu->scsi.device_status = scmd->result & 0xff;
Please use the status_byte() macro instead of open-coding it.
Thanks,
Bart.