Skip to content
Snippets Groups Projects
Commit 2492f087 authored by chrfranke's avatar chrfranke
Browse files

smartctl: Don't report an attribute as failed if threshold is 0.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2860 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent d77b5caf
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,8 @@ NOTES FOR FUTURE RELEASES: see TODO file. ...@@ -42,6 +42,8 @@ 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>
[CF] smartctl: Don't report an attribute as failed if threshold is 0.
[CF] Print only one warning on checksum errors in multi sector log. [CF] Print only one warning on checksum errors in multi sector log.
Remove casts from calls of checksum(). Remove casts from calls of checksum().
......
...@@ -794,11 +794,15 @@ static void PrintSmartAttribWithThres(const ata_smart_values * data, ...@@ -794,11 +794,15 @@ static void PrintSmartAttribWithThres(const ata_smart_values * data,
// thresholds page data to slip by) // thresholds page data to slip by)
if (disk->id){ if (disk->id){
const char *type, *update; const char *type, *update;
int failednow,failedever;
char attributename[64]; char attributename[64];
failednow = (disk->current <= thre->threshold); // Don't report a failed attribute if its threshold is 0.
failedever= (disk->worst <= thre->threshold); // ATA-3 (X3T13/2008D Revision 7b) declares 0x00 as the "always passing"
// threshold (Later ATA versions declare all thresholds as "obsolete").
// In practice, threshold value 0 is often used for usage attributes or
// appears if the thresholds cannot be read.
bool failednow = (thre->threshold > 0 && disk->current <= thre->threshold);
bool failedever = (thre->threshold > 0 && disk->worst <= thre->threshold);
// These break out of the loop if we are only printing certain entries... // These break out of the loop if we are only printing certain entries...
if (onlyfailed==1 && (!ATTRIBUTE_FLAGS_PREFAILURE(disk->flags) || !failednow)) if (onlyfailed==1 && (!ATTRIBUTE_FLAGS_PREFAILURE(disk->flags) || !failednow))
...@@ -841,8 +845,9 @@ static void PrintSmartAttribWithThres(const ata_smart_values * data, ...@@ -841,8 +845,9 @@ static void PrintSmartAttribWithThres(const ata_smart_values * data,
ataPrintSmartAttribRawValue(rawstring, disk, attributedefs); ataPrintSmartAttribRawValue(rawstring, disk, attributedefs);
pout("%s\n", rawstring); pout("%s\n", rawstring);
// print a warning if there is inconsistency here! // Print a warning if there is inconsistency here and
if (disk->id != thre->id){ // threshold info is not empty.
if (disk->id != thre->id && (thre->id || thre->threshold)) {
char atdat[64],atthr[64]; char atdat[64],atthr[64];
ataPrintSmartAttribName(atdat, disk->id, attributedefs); ataPrintSmartAttribName(atdat, disk->id, attributedefs);
ataPrintSmartAttribName(atthr, thre->id, attributedefs); ataPrintSmartAttribName(atthr, thre->id, attributedefs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment