Re: POWER MODE and sat,12 again
Christian Franke <[email protected]>
| Newsgroups | gmane.linux.utilities.smartmontools |
|---|---|
| Message-ID | <[email protected]> |
Alfred, Alfred Ganz wrote: > I probably will add some flag, e.g. "-d sat,12,i" to indicate that the > error sense key should be ignored in this case. > That would be much appreciated. With the attached patch, a bogus sense key is ignored if the returned ATA status register indicates success. No extra -d sat flag is needed for now. If possible, please test this patch with smartmontools-6.4 or current SVN. Thanks, Christian ------------------------------------------------------------------------------ _______________________________________________ Smartmontools-support mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/smartmontools-support
sat-ignore-sense_key.patch
(text/x-patch, 799 B)
Index: scsiata.cpp
===================================================================
--- scsiata.cpp (revision 4116)
+++ scsiata.cpp (working copy)
@@ -394,6 +394,15 @@
}
scsi_do_sense_disect(&io_hdr, &sinfo);
int status = scsiSimpleSenseFilter(&sinfo);
+
+ if ( status && ck_cond && ardp && ard_len > 13
+ && (ardp[13] & 0xc1) == 0x40 /* !BSY && DRDY && !ERR */) {
+ if (scsi_debugmode > 0)
+ pout("ATA status (0x%02x) indicates success, ignoring SCSI sense key\n",
+ ardp[13]);
+ status = 0;
+ }
+
if (0 != status) { /* other than no_sense and recovered_error */
if (scsi_debugmode > 0) {
pout("sat_device::ata_pass_through: scsi error: %s\n",