Skip to content
Snippets Groups Projects
Commit 875867b3 authored by dpgilbert's avatar dpgilbert
Browse files

Somewhat controversial patch to accept half healthy and half unhealthy

indications from the ATA SMART RETURN STATUS command.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2698 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 11d68df6
No related branches found
No related tags found
No related merge requests found
CHANGELOG for smartmontools CHANGELOG for smartmontools
$Id: CHANGELOG,v 1.758 2008/12/26 22:12:48 manfred99 Exp $ $Id: CHANGELOG,v 1.759 2009/01/08 22:05:38 dpgilbert Exp $
The most recent version of this file is: The most recent version of this file is:
http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup
...@@ -41,6 +41,13 @@ NOTES FOR FUTURE RELEASES: see TODO file. ...@@ -41,6 +41,13 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[DG] Accept half healthy (and half unhealthy) indication from the
SMART RETURN STATUS. This makes allowance for SAT implementations
(e.g. via USB) that truncate the SCSI sense buffer to 18 bytes.
This truncation causes the SMART RETURN STATUS indication to be
half health or unhealthy. If the half indication is used, then
warn if '-r ioctl' is given.
[MS] knowndrives.cpp updates: [MS] knowndrives.cpp updates:
- Added Apple SSD - Added Apple SSD
- Added Seagate U8 family - Added Seagate U8 family
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include <algorithm> // std::sort #include <algorithm> // std::sort
const char *atacmds_c_cvsid="$Id: atacmds.cpp,v 1.209 2008/10/24 21:43:12 manfred99 Exp $" const char *atacmds_c_cvsid="$Id: atacmds.cpp,v 1.210 2009/01/08 22:05:38 dpgilbert Exp $"
ATACMDS_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSIATA_H_CVSID UTILITY_H_CVSID; ATACMDS_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSIATA_H_CVSID UTILITY_H_CVSID;
// for passing global control variables // for passing global control variables
...@@ -48,6 +48,13 @@ extern smartmonctrl *con; ...@@ -48,6 +48,13 @@ extern smartmonctrl *con;
#define SMART_CYL_LOW 0x4F #define SMART_CYL_LOW 0x4F
#define SMART_CYL_HI 0xC2 #define SMART_CYL_HI 0xC2
// SMART RETURN STATUS yields SMART_CYL_HI,SMART_CYL_LOW to indicate drive
// is healthy and SRET_STATUS_HI_EXCEEDED,SRET_STATUS_MID_EXCEEDED to
// indicate that a threshhold exceeded condition has been detected.
// Those values (byte pairs) are placed in ATA register "LBA 23:8".
#define SRET_STATUS_HI_EXCEEDED 0x2C
#define SRET_STATUS_MID_EXCEEDED 0xF4
// These Drive Identity tables are taken from hdparm 5.2, and are also // These Drive Identity tables are taken from hdparm 5.2, and are also
// given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note // given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note
// that SMART was first added into the ATA/ATAPI-3 Standard with // that SMART was first added into the ATA/ATAPI-3 Standard with
...@@ -629,12 +636,24 @@ int smartcommandhandler(ata_device * device, smart_command_set command, int sele ...@@ -629,12 +636,24 @@ int smartcommandhandler(ata_device * device, smart_command_set command, int sele
break; break;
case STATUS_CHECK: case STATUS_CHECK:
// Cyl low and Cyl high unchanged means "Good SMART status" // Cyl low and Cyl high unchanged means "Good SMART status"
if (out.out_regs.lba_high == SMART_CYL_HI && out.out_regs.lba_mid == SMART_CYL_LOW) if ((out.out_regs.lba_high == SMART_CYL_HI) &&
(out.out_regs.lba_mid == SMART_CYL_LOW))
retval = 0; retval = 0;
// These values mean "Bad SMART status" // These values mean "Bad SMART status"
else if (out.out_regs.lba_high == 0x2c && out.out_regs.lba_mid == 0xf4) else if ((out.out_regs.lba_high == SRET_STATUS_HI_EXCEEDED) &&
(out.out_regs.lba_mid == SRET_STATUS_MID_EXCEEDED))
retval = 1; retval = 1;
else { else if (out.out_regs.lba_mid == SMART_CYL_LOW) {
retval = 0;
if (con->reportataioctl)
pout("SMART STATUS RETURN: half healthy response sequence, "
"probable SAT/USB truncation\n");
} else if (out.out_regs.lba_mid == SRET_STATUS_MID_EXCEEDED) {
retval = 1;
if (con->reportataioctl)
pout("SMART STATUS RETURN: half unhealthy response sequence, "
"probable SAT/USB truncation\n");
} else {
// We haven't gotten output that makes sense; print out some debugging info // We haven't gotten output that makes sense; print out some debugging info
pout("Error SMART Status command failed\n" pout("Error SMART Status command failed\n"
"Please get assistance from %s\n", PACKAGE_HOMEPAGE); "Please get assistance from %s\n", PACKAGE_HOMEPAGE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment