Skip to content

Commit d9512a9

Browse files
authored
Merge pull request #196 from truenas/NAS-131827
NAS-131827 / 24.10.1 / Revert "ata: libata-scsi: Honor the D_SENSE bit for CK_COND=1 and no error
2 parents 03cf828 + 4d2c304 commit d9512a9

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
@@ -941,8 +941,19 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc)
941941
&sense_key, &asc, &ascq);
942942
ata_scsi_set_sense(qc->dev, cmd, sense_key, asc, ascq);
943943
} else {
944-
/* ATA PASS-THROUGH INFORMATION AVAILABLE */
945-
ata_scsi_set_sense(qc->dev, cmd, RECOVERED_ERROR, 0, 0x1D);
944+
/*
945+
* ATA PASS-THROUGH INFORMATION AVAILABLE
946+
*
947+
* Note: we are supposed to call ata_scsi_set_sense(), which
948+
* respects the D_SENSE bit, instead of unconditionally
949+
* generating the sense data in descriptor format. However,
950+
* because hdparm, hddtemp, and udisks incorrectly assume sense
951+
* data in descriptor format, without even looking at the
952+
* RESPONSE CODE field in the returned sense data (to see which
953+
* format the returned sense data is in), we are stuck with
954+
* being bug compatible with older kernels.
955+
*/
956+
scsi_build_sense(cmd, 1, RECOVERED_ERROR, 0, 0x1D);
946957
}
947958
}
948959

0 commit comments

Comments
 (0)