diff --git a/smartmontools/CHANGELOG b/smartmontools/CHANGELOG index 5cbad8d0c621452116761d280ef13ea91adc72e5..d99985df9f4d314d35907698f667957949b9bdfa 100644 --- a/smartmontools/CHANGELOG +++ b/smartmontools/CHANGELOG @@ -43,6 +43,10 @@ NOTES FOR FUTURE RELEASES: see TODO file. <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> + [CF] smartd '-l selftest' directive: Print info if error count + decreased. Avoid misleading warning if error count decreased + to zero (ticket #67). + [CF] smartctl: Rework ataPrintMain(). Issue ATA SMART commands only if necessary. Improve handling of SMART STATUS command failure when ATA output registers are missing (ticket #27). diff --git a/smartmontools/smartd.cpp b/smartmontools/smartd.cpp index b8eaa09c4b671bb115cca122fd148d95ddb52380..cdd29b042c7df6e93c7ce7e04473e59f9fc4905b 100644 --- a/smartmontools/smartd.cpp +++ b/smartmontools/smartd.cpp @@ -2058,7 +2058,8 @@ static void CheckSelfTestLogs(const dev_config & cfg, dev_state & state, int new MailWarning(cfg, state, 3, "Device: %s, Self-Test Log error count increased from %d to %d", name, oldc, newc); state.must_write = true; - } else if (oldh!=newh) { + } + else if (newc > 0 && oldh != newh) { // more recent error // a 'more recent' error might actually be a smaller hour number, // if the hour number has wrapped. @@ -2072,7 +2073,12 @@ static void CheckSelfTestLogs(const dev_config & cfg, dev_state & state, int new name, newh); state.must_write = true; } - + + // Print info if error entries have disappeared + if (oldc > newc) + PrintOut(LOG_INFO, "Device: %s, Self-Test Log error count decreased from %d to %d\n", + name, oldc, newc); + // Needed since self-test error count may DECREASE. Hour might // also have changed. state.selflogcount= newc;