ata: libata-scsi: report correct sense field pointer in ata_scsiop_maint_in()
Damien Le Moal
maintainerPATCH 1/1 ata: libata-scsi: report correct sense field pointer in ata_scsiop_maint_in()
Commit 4ab7bb976343 ("ata: libata-scsi: Refactor ata_scsiop_maint_in()") modified ata_scsiop_maint_in() to directly call ata_scsi_set_invalid_field() to set the field pointer of the sense data of a failed MAINTENANCE IN command. However, in the case of an invalid command format, the sense data field incorrectly indicates byte 1 of the CDB. Fix this to indicate byte 2 of the command.
--- drivers/ata/libata-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/libata-scsi.c +1 -1
@@ -3600,7 +3600,7 @@ static unsigned int ata_scsiop_maint_in(struct ata_device *dev,if (cdb[2 ] !=1 && cdb[2 ] !=3 ) {ata_dev_warn (dev,"invalid command format %d\n" , cdb[2 ]); -ata_scsi_set_invalid_field (dev, cmd,1 ,0xff ); +ata_scsi_set_invalid_field (dev, cmd,2 ,0xff );return 0 ; }
Signature · 1 line
2.53.0
Quoted 8 lines · Damien Le Moal
Commit
4ab7bb976343("ata: libata-scsi: Refactorata_scsiop_maint_in()") modifiedata_scsiop_maint_in()to directly callata_scsi_set_invalid_field()to set the field pointer of the sense data of a failed MAINTENANCE IN command. However, in the case of an invalid command format, the sense data field incorrectly indicates byte 1 of the CDB. Fix this to indicate byte 2 of the command.[...]
Applied to libata/linux.git (for-7.0-fixes), thanks!
[1/1] ata: libata-scsi: report correct sense field pointer in ata_scsiop_maint_in()
https://git.kernel.org/libata/linux/c/e6d7eba2
Kind regards,
Niklas