Skip to content

Commit 6e80a1f

Browse files
committed
Merge tag 'ata-6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux
Pull ata fix from Niklas Cassel: - Revert a recent change to sense data generation. Sense data can be in either fixed format or descriptor format. The D_SENSE bit in the Control mode page controls which format to generate. All places but one respected the D_SENSE bit. The recent change fixed the one place that didn't respect the D_SENSE bit. However, it turns out that hdparm, hddtemp and udisks (incorrectly) assumes sense data in descriptor format. Therefore, even while the change was technically correct, revert it, since even if these user space programs are fixed to (correctly) look at the format type before parsing the data, older versions of these tools will be around roughly forever. * tag 'ata-6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux: Revert "ata: libata-scsi: Honor the D_SENSE bit for CK_COND=1 and no error"
2 parents 1fb9189 + fa0db8e commit 6e80a1f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/ata/libata-scsi.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,19 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc)
951951
&sense_key, &asc, &ascq);
952952
ata_scsi_set_sense(qc->dev, cmd, sense_key, asc, ascq);
953953
} else {
954-
/* ATA PASS-THROUGH INFORMATION AVAILABLE */
955-
ata_scsi_set_sense(qc->dev, cmd, RECOVERED_ERROR, 0, 0x1D);
954+
/*
955+
* ATA PASS-THROUGH INFORMATION AVAILABLE
956+
*
957+
* Note: we are supposed to call ata_scsi_set_sense(), which
958+
* respects the D_SENSE bit, instead of unconditionally
959+
* generating the sense data in descriptor format. However,
960+
* because hdparm, hddtemp, and udisks incorrectly assume sense
961+
* data in descriptor format, without even looking at the
962+
* RESPONSE CODE field in the returned sense data (to see which
963+
* format the returned sense data is in), we are stuck with
964+
* being bug compatible with older kernels.
965+
*/
966+
scsi_build_sense(cmd, 1, RECOVERED_ERROR, 0, 0x1D);
956967
}
957968
}
958969

0 commit comments

Comments
 (0)