diff options
author | Damien Le Moal <dlemoal@kernel.org> | 2024-10-22 11:45:37 +0900 |
---|---|---|
committer | Niklas Cassel <cassel@kernel.org> | 2024-10-25 10:09:49 +0200 |
commit | 5251ae224d8d3caa21b28d12408062b6e75cffad (patch) | |
tree | 3927ad3c19173889f51e86b491a27b2c3a93a298 /Makefile | |
parent | 2365278e03916b6b9a65df91e9f7c7afe5a6cf2e (diff) |
ata: libata-scsi: Return residual for emulated SCSI commands
The function ata_scsi_rbuf_fill() used to fill the reply buffer of
emulated SCSI commands always copies the ATA reply buffer
(ata_scsi_rbuf) up to the size of the SCSI command buffer (the transfer
length for the command), even if the reply is shorter than the SCSI
command buffer. This leads to issuers of the SCSI command to always get
a result without any residual (resid is always 0) despite the
potentially shorter reply for the command.
Modify all fill actors used by ata_scsi_rbuf_fill() to return the number
of bytes filled for the reply and 0 in case of error. Using this value,
add a call to scsi_set_resid() in ata_scsi_rbuf_fill() to set the
correct residual for the SCSI command when the reply length is shorter
than the command buffer.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20241022024537.251905-7-dlemoal@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions