Skip to content
Snippets Groups Projects
Commit 085e633a authored by ballen4705's avatar ballen4705
Browse files

Final clean-up before issuing a new release, I hope!

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@69 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent c916c4c1
No related branches found
No related tags found
No related merge requests found
CHANGELOG for smartmontools CHANGELOG for smartmontools
$Id: CHANGELOG,v 1.8 2002/10/17 04:10:44 ballen4705 Exp $ $Id: CHANGELOG,v 1.9 2002/10/20 19:40:23 ballen4705 Exp $
Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net> Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
...@@ -21,6 +21,71 @@ Research Center), Jack Baskin School of Engineering, University of ...@@ -21,6 +21,71 @@ Research Center), Jack Baskin School of Engineering, University of
California, Santa Cruz. http://ssrc.soe.ucsc.edu/ California, Santa Cruz. http://ssrc.soe.ucsc.edu/
NOTES FOR NEXT RELEASE:
Next release: handle extended error and self-test logs gracefully.
Parse and print attribute flag meanings
smartmontools-5.0-11
smartctl now handles all possible choices of "multiple options"
gracefully. It goes through the following phases of operation,
in order: INFORMATION, ENABLE/DISABLE, DISPLAY DATA, RUN/ABORT TESTS.
Documentation has bee updated to explain the different phases of
operation. Control flow through ataPrintMain()
simplified.
Modified Makefile to automatically tag CVS archive on issuance of
a release
Modified drive detection so minor device ID code showing ATA-3 rev
0 (no SMART) is known to not be SMART capable.
Now verify the checksum of the device ID data structure, and of the
attributes threshold structure. Before neither of these
structures had their checksums verified.
New behavior vis-a-vis checksums. If they are wrong, we log
warning messages to stdout, stderr, and syslog, but carry on
anyway. All functions now call a checksumwarning routine if the
checksum doesn't vanish as it should.
Changed Read Hard Disk Identity function to get fresh info from
the disk on each call rather than to use the values that were read
upon boot-up into the BIOS. This is the biggest change in this
release. The ioctl(device, HDIO_GET_IDENTITY, buf ) call should
be avoided in such code. Note that if people get garbled strings
for the model, serial no and firmware versions of their drives,
then blame goes here (the BIOS does the byte swapping for you,
apparently!)
Function ataSmartSupport now looks at correct bits in drive
identity structure to verify first that these bits are valid,
before using them.
Function ataIsSmartEnabled() written which uses the Drive ID state
information to tell if SMART is enabled or not. We'll carry this
along for the moment without using it.
Function ataDoesSmartWork() guaranteed to work if the device
supports SMART.
Replace some numbers by #define MACROS
Wrote Function TestTime to return test time associated with each
different type of test.
Thinking of the future, have added a new function called
ataSmartStatus2(). Eventually when I understand how to use the
TASKFILE API and am sure that this works correctly, it will
replace ataSmartStatus(). This queries the drive directly to
see if the SMART status is OK, rather than comparing thresholds to
attribute values ourselves. But I need to get some drives that fail
their SMART status to check it.
smartmontools-5.0-10 smartmontools-5.0-10
Removed extraneous space before printing in some error messages Removed extraneous space before printing in some error messages
Fixed additional typos in documentation Fixed additional typos in documentation
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Home page: http://smartmontools.sourceforge.net # Home page: http://smartmontools.sourceforge.net
# #
# $Id: Makefile,v 1.18 2002/10/17 04:33:48 ballen4705 Exp $ # $Id: Makefile,v 1.19 2002/10/20 19:40:23 ballen4705 Exp $
# #
# Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net> # Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
# #
...@@ -92,6 +92,5 @@ release: $(releasefiles) ...@@ -92,6 +92,5 @@ release: $(releasefiles)
mv /usr/src/redhat/SRPMS/$(pkgname)*rpm . mv /usr/src/redhat/SRPMS/$(pkgname)*rpm .
rm -f /usr/src/redhat/SOURCES/$(pkgname).tar.gz rm -f /usr/src/redhat/SOURCES/$(pkgname).tar.gz
. cvs-script && cvs commit -m "release $(counter)" . cvs-script && cvs commit -m "release $(counter)"
. cvs-script && cvs tag "RELEASE_5_0_$(counter)"
echo `hostname` | grep -q ballen && echo $(newcounter) > VERSION echo `hostname` | grep -q ballen && echo $(newcounter) > VERSION
...@@ -4,7 +4,7 @@ Home page of code is: http://smartmontools.sourceforge.net ...@@ -4,7 +4,7 @@ Home page of code is: http://smartmontools.sourceforge.net
Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net> Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
$Id: TODO,v 1.7 2002/10/15 14:24:26 ballen4705 Exp $ $Id: TODO,v 1.8 2002/10/20 19:40:23 ballen4705 Exp $
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
...@@ -49,3 +49,6 @@ int ataSmartStatus (int device ) is broken -- see comments in code. ...@@ -49,3 +49,6 @@ int ataSmartStatus (int device ) is broken -- see comments in code.
SCSI code in smartd leaves file descriptors open if SMART not supported.. SCSI code in smartd leaves file descriptors open if SMART not supported..
Fix lots of syntax like if (a != 0) Fix lots of syntax like if (a != 0)
Pass pointer to big structures like "device" and smartval, not the
whole 2kB of data!
10 11
// $Id: atacmds.c,v 1.9 2002/10/20 19:22:02 ballen4705 Exp $ // $Id: atacmds.c,v 1.10 2002/10/20 19:40:23 ballen4705 Exp $
/* /*
* atacmds.c * atacmds.c
* *
...@@ -148,17 +148,13 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){ ...@@ -148,17 +148,13 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){
// copy data into driveid structure // copy data into driveid structure
memcpy(buf,parms+HDIO_DRIVE_CMD_HDR_SIZE,sizeof(*buf)); memcpy(buf,parms+HDIO_DRIVE_CMD_HDR_SIZE,sizeof(*buf));
// If driveid structure contains a checksum, then compute it, and
// issue a warning message if something is wrong. I prefer this
// rather than simply exiting at this point, though that is another
// option.
// Note -- the declaration that appears in // Note -- the declaration that appears in
// /usr/include/linux/hdregs.h: short words160_255[95], is WRONG. // /usr/include/linux/hdregs.h: short words160_255[95], is WRONG.
// It should say: short words160_255[96]. I have written to Andre // It should say: short words160_255[96]. I have written to Andre
// Hedrick about this on Oct 17 2002. Please remove this comment // Hedrick about this on Oct 17 2002. Please remove this comment
// once the fix has made it into the stock kernel tree. // once the fix has made it into the stock kernel tree.
if ((buf->words160_255[95] & 0x00ff) == 0x00a5){ if ((buf->words160_255[95] & 0x00ff) == 0x00a5){
// Device identity structure contains a checksum
unsigned char cksum=0; unsigned char cksum=0;
int i; int i;
...@@ -312,7 +308,7 @@ int ataReadErrorLog (int device, struct ata_smart_errorlog *data){ ...@@ -312,7 +308,7 @@ int ataReadErrorLog (int device, struct ata_smart_errorlog *data){
{WIN_SMART, 0x01, SMART_READ_LOG_SECTOR, 1,}; {WIN_SMART, 0x01, SMART_READ_LOG_SECTOR, 1,};
// get data from device // get data from device
if (ioctl(device,HDIO_DRIVE_CMD,&buf)) { if (ioctl(device,HDIO_DRIVE_CMD,buf)) {
perror ("SMART Error Log Read failed"); perror ("SMART Error Log Read failed");
return -1; return -1;
} }
...@@ -375,19 +371,16 @@ int ataSetSmartThresholds ( int device, struct ata_smart_thresholds *data){ ...@@ -375,19 +371,16 @@ int ataSetSmartThresholds ( int device, struct ata_smart_thresholds *data){
return 0; return 0;
} }
int ataEnableSmart (int device ){ int ataEnableSmart (int device ){
unsigned char parms[4] = {WIN_SMART, 1, SMART_ENABLE, 0}; unsigned char parms[4] = {WIN_SMART, 1, SMART_ENABLE, 0};
if (ioctl ( device , HDIO_DRIVE_CMD, &parms )){ if (ioctl (device, HDIO_DRIVE_CMD, parms)){
perror ("SMART Enable failed"); perror ("SMART Enable failed");
return -1; return -1;
} }
return 0; return 0;
} }
int ataDisableSmart (int device ){ int ataDisableSmart (int device ){
unsigned char parms[4] = {WIN_SMART, 1, SMART_DISABLE, 0}; unsigned char parms[4] = {WIN_SMART, 1, SMART_DISABLE, 0};
...@@ -395,7 +388,6 @@ int ataDisableSmart (int device ){ ...@@ -395,7 +388,6 @@ int ataDisableSmart (int device ){
perror ("SMART Disable failed"); perror ("SMART Disable failed");
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -406,7 +398,6 @@ int ataEnableAutoSave(int device){ ...@@ -406,7 +398,6 @@ int ataEnableAutoSave(int device){
perror ("SMART Enable Auto-save failed"); perror ("SMART Enable Auto-save failed");
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -417,7 +408,6 @@ int ataDisableAutoSave(int device){ ...@@ -417,7 +408,6 @@ int ataDisableAutoSave(int device){
perror ("SMART Disable Auto-save failed"); perror ("SMART Disable Auto-save failed");
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -431,7 +421,6 @@ int ataEnableAutoOffline (int device ){ ...@@ -431,7 +421,6 @@ int ataEnableAutoOffline (int device ){
perror ("SMART Enable Automatic Offline failed"); perror ("SMART Enable Automatic Offline failed");
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -443,7 +432,6 @@ int ataDisableAutoOffline (int device ){ ...@@ -443,7 +432,6 @@ int ataDisableAutoOffline (int device ){
perror ("SMART Disable Automatic Offline failed"); perror ("SMART Disable Automatic Offline failed");
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -491,7 +479,7 @@ int ataSmartStatus2(int device){ ...@@ -491,7 +479,7 @@ int ataSmartStatus2(int device){
parms[4]=normal_cyl_lo; parms[4]=normal_cyl_lo;
parms[5]=normal_cyl_hi; parms[5]=normal_cyl_hi;
if (ioctl(device,HDIO_DRIVE_TASK,&parms)){ if (ioctl(device,HDIO_DRIVE_TASK,parms)){
perror ("SMART Status command failed."); perror ("SMART Status command failed.");
return -1; return -1;
} }
......
// $Id: atacmds.cpp,v 1.9 2002/10/20 19:22:02 ballen4705 Exp $ // $Id: atacmds.cpp,v 1.10 2002/10/20 19:40:23 ballen4705 Exp $
/* /*
* atacmds.c * atacmds.c
* *
...@@ -148,17 +148,13 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){ ...@@ -148,17 +148,13 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){
// copy data into driveid structure // copy data into driveid structure
memcpy(buf,parms+HDIO_DRIVE_CMD_HDR_SIZE,sizeof(*buf)); memcpy(buf,parms+HDIO_DRIVE_CMD_HDR_SIZE,sizeof(*buf));
// If driveid structure contains a checksum, then compute it, and
// issue a warning message if something is wrong. I prefer this
// rather than simply exiting at this point, though that is another
// option.
// Note -- the declaration that appears in // Note -- the declaration that appears in
// /usr/include/linux/hdregs.h: short words160_255[95], is WRONG. // /usr/include/linux/hdregs.h: short words160_255[95], is WRONG.
// It should say: short words160_255[96]. I have written to Andre // It should say: short words160_255[96]. I have written to Andre
// Hedrick about this on Oct 17 2002. Please remove this comment // Hedrick about this on Oct 17 2002. Please remove this comment
// once the fix has made it into the stock kernel tree. // once the fix has made it into the stock kernel tree.
if ((buf->words160_255[95] & 0x00ff) == 0x00a5){ if ((buf->words160_255[95] & 0x00ff) == 0x00a5){
// Device identity structure contains a checksum
unsigned char cksum=0; unsigned char cksum=0;
int i; int i;
...@@ -312,7 +308,7 @@ int ataReadErrorLog (int device, struct ata_smart_errorlog *data){ ...@@ -312,7 +308,7 @@ int ataReadErrorLog (int device, struct ata_smart_errorlog *data){
{WIN_SMART, 0x01, SMART_READ_LOG_SECTOR, 1,}; {WIN_SMART, 0x01, SMART_READ_LOG_SECTOR, 1,};
// get data from device // get data from device
if (ioctl(device,HDIO_DRIVE_CMD,&buf)) { if (ioctl(device,HDIO_DRIVE_CMD,buf)) {
perror ("SMART Error Log Read failed"); perror ("SMART Error Log Read failed");
return -1; return -1;
} }
...@@ -375,19 +371,16 @@ int ataSetSmartThresholds ( int device, struct ata_smart_thresholds *data){ ...@@ -375,19 +371,16 @@ int ataSetSmartThresholds ( int device, struct ata_smart_thresholds *data){
return 0; return 0;
} }
int ataEnableSmart (int device ){ int ataEnableSmart (int device ){
unsigned char parms[4] = {WIN_SMART, 1, SMART_ENABLE, 0}; unsigned char parms[4] = {WIN_SMART, 1, SMART_ENABLE, 0};
if (ioctl ( device , HDIO_DRIVE_CMD, &parms )){ if (ioctl (device, HDIO_DRIVE_CMD, parms)){
perror ("SMART Enable failed"); perror ("SMART Enable failed");
return -1; return -1;
} }
return 0; return 0;
} }
int ataDisableSmart (int device ){ int ataDisableSmart (int device ){
unsigned char parms[4] = {WIN_SMART, 1, SMART_DISABLE, 0}; unsigned char parms[4] = {WIN_SMART, 1, SMART_DISABLE, 0};
...@@ -395,7 +388,6 @@ int ataDisableSmart (int device ){ ...@@ -395,7 +388,6 @@ int ataDisableSmart (int device ){
perror ("SMART Disable failed"); perror ("SMART Disable failed");
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -406,7 +398,6 @@ int ataEnableAutoSave(int device){ ...@@ -406,7 +398,6 @@ int ataEnableAutoSave(int device){
perror ("SMART Enable Auto-save failed"); perror ("SMART Enable Auto-save failed");
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -417,7 +408,6 @@ int ataDisableAutoSave(int device){ ...@@ -417,7 +408,6 @@ int ataDisableAutoSave(int device){
perror ("SMART Disable Auto-save failed"); perror ("SMART Disable Auto-save failed");
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -431,7 +421,6 @@ int ataEnableAutoOffline (int device ){ ...@@ -431,7 +421,6 @@ int ataEnableAutoOffline (int device ){
perror ("SMART Enable Automatic Offline failed"); perror ("SMART Enable Automatic Offline failed");
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -443,7 +432,6 @@ int ataDisableAutoOffline (int device ){ ...@@ -443,7 +432,6 @@ int ataDisableAutoOffline (int device ){
perror ("SMART Disable Automatic Offline failed"); perror ("SMART Disable Automatic Offline failed");
return -1; return -1;
} }
return 0; return 0;
} }
...@@ -491,7 +479,7 @@ int ataSmartStatus2(int device){ ...@@ -491,7 +479,7 @@ int ataSmartStatus2(int device){
parms[4]=normal_cyl_lo; parms[4]=normal_cyl_lo;
parms[5]=normal_cyl_hi; parms[5]=normal_cyl_hi;
if (ioctl(device,HDIO_DRIVE_TASK,&parms)){ if (ioctl(device,HDIO_DRIVE_TASK,parms)){
perror ("SMART Status command failed."); perror ("SMART Status command failed.");
return -1; return -1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment