Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Kalle Olavi Niemitalo <kon@iki.fi>
Subject: Re: Testers needed: is smartmontools is 64-bit clean?
Date: Sun, 29 Jun 2003 19:17:13 +0300	[thread overview]
Message-ID: <87y8zkrh86.fsf@Astalo.kon.iki.fi> (raw)
In-Reply-To: <f30697fb.0306290708.417fc0aa@posting.google.com> (Bruce Allen's message of "29 Jun 2003 08:08:29 -0700")

ballen@uwm.edu (Bruce Allen) writes:

> Before generating a new release, I would also like to verify
> that the code is 64-bit clean.

In a few places, the code was trying to print (64-bit) size_t
values with "%d".  The following patches cast these to (32-bit)
int, which ought to be large enough.

--- atacmds.c.~1.107.~	Mon Jun 23 07:55:56 2003
+++ atacmds.c	Sun Jun 29 18:58:42 2003
@@ -726,14 +726,14 @@ int ataVersionInfo (const char** descrip
   if (sizeof(minor_str) != sizeof(char *)*(1+MINOR_MAX)){
     pout("Internal error in ataVersionInfo().  minor_str[] size %d\n"
 	 "is not consistent with value of MINOR_MAX+1 = %d\n", 
-	 sizeof(minor_str)/sizeof(char *), MINOR_MAX+1);
+	 (int) (sizeof(minor_str)/sizeof(char *)), MINOR_MAX+1);
     fflush(NULL);
     abort();
   }
   if (sizeof(actual_ver) != sizeof(int)*(1+MINOR_MAX)){
     pout("Internal error in ataVersionInfo().  actual_ver[] size %d\n"
 	 "is not consistent with value of MINOR_MAX = %d\n",
-	 sizeof(actual_ver)/sizeof(int), MINOR_MAX+1);
+	 (int) (sizeof(actual_ver)/sizeof(int)), MINOR_MAX+1);
     fflush(NULL);
     abort();
   }
--- scsicmds.c.~1.49.~	Fri Jun 20 16:24:04 2003
+++ scsicmds.c	Sun Jun 29 18:58:40 2003
@@ -196,7 +196,7 @@ static int linux_do_scsi_cmnd_io(int dev
             (DXFER_TO_DEVICE == iop->dxfer_dir) && (iop->dxferp)) {
             int trunc = (iop->dxfer_len > 256) ? 1 : 0;
 
-            pout("]\n  Outgoing data, len=%d%s:\n", iop->dxfer_len,
+            pout("]\n  Outgoing data, len=%d%s:\n", (int) iop->dxfer_len,
                  (trunc ? " [only first 256 bytes shown]" : ""));
             dStrHex(iop->dxferp, (trunc ? 256 : iop->dxfer_len) , 1);
         }
@@ -242,7 +242,7 @@ static int linux_do_scsi_cmnd_io(int dev
             if (con->reportscsiioctl > 1) {
                 int trunc = (iop->dxfer_len > 256) ? 1 : 0;
 
-                pout("  Incoming data, len=%d%s:\n", iop->dxfer_len,
+                pout("  Incoming data, len=%d%s:\n", (int) iop->dxfer_len,
                      (trunc ? " [only first 256 bytes shown]" : ""));
                 dStrHex(iop->dxferp, (trunc ? 256 : iop->dxfer_len) , 1);
             }
@@ -259,7 +259,7 @@ static int linux_do_scsi_cmnd_io(int dev
         memcpy(iop->sensep, wrk.buff, len);
         iop->resp_sense_len = len;
         if (con->reportscsiioctl > 1) {
-            pout("  >>> Sense buffer, len=%d:\n", len);
+            pout("  >>> Sense buffer, len=%d:\n", (int) len);
             dStrHex(wrk.buff, len , 1);
         }
     }

> Then send or post the output of smartctl -a for any ATA or SCSI
> devices that you have.

This is from an Alphastation 500/266 with two SCSI disks.
First, the old noisy one:

| smartctl version 5.1-15 Copyright (C) 2002-3 Bruce Allen
| Home page is http://smartmontools.sourceforge.net/
| 
| Device: DEC      RZ29B    (C) DEC Version: 0014
| Serial number: 01185069
| Device type: disk
| Local Time is: Sun Jun 29 19:09:04 2003 EEST
| Device does not support SMART
| 
| Error counter log:
|           Errors Corrected    Total      Total   Correction     Gigabytes    Total
|               delay:       [rereads/    errors   algorithm      processed    uncorrected
|             minor | major  rewrites]  corrected  invocations   [10^9 bytes]  errors
| read:          0        0         0         0          0          0.000           0
| write:         0        0         0         0          0          0.000           0
| Device does not support Self Test logging

I normally keep the disk spun down.  In this mode, the output
changes to:

| smartctl version 5.1-15 Copyright (C) 2002-3 Bruce Allen
| Home page is http://smartmontools.sourceforge.net/
| 
| Device: DEC      RZ29B    (C) DEC Version: 0014
| Serial number: 01185069
| Device type: disk
| Local Time is: Sun Jun 29 19:10:50 2003 EEST
| device is NOT READY (media absent, spun down, etc)
| SMART Health Status: OK
| 
| Error counter log:
|           Errors Corrected    Total      Total   Correction     Gigabytes    Total
|               delay:       [rereads/    errors   algorithm      processed    uncorrected
|             minor | major  rewrites]  corrected  invocations   [10^9 bytes]  errors
| read:          0        0         0         0          0          0.000           0
| write:         0        0         0         0          0          0.000           0
| Device does not support Self Test logging

"SMART Health Status: OK"?  That doesn't look right.

Then, the newer disk:

| smartctl version 5.1-15 Copyright (C) 2002-3 Bruce Allen
| Home page is http://smartmontools.sourceforge.net/
| 
| Device: QUANTUM  ATLAS10K3_18_WLS Version: 020W
| Serial number: 342210449270
| Device type: disk
| Local Time is: Sun Jun 29 19:13:01 2003 EEST
| Device supports SMART and is Enabled
| Temperature Warning Enabled
| SMART Health Status: OK
| Current Drive Temperature:     39 C
| Manufactured in week 14 of year 2002
| Current start stop count:      73 times
| Recommended start stop count:  4294967295 times
| 
| Error counter log:
|           Errors Corrected    Total      Total   Correction     Gigabytes    Total
|               delay:       [rereads/    errors   algorithm      processed    uncorrected
|             minor | major  rewrites]  corrected  invocations   [10^9 bytes]  errors
| read:       1426        0         0         0          0          0.227           0
| write:         0        0         0         0          0          0.168           0
| 
| Non-medium error count:        2
| No self-tests have been logged
| Long (extended) Self Test duration: 672 seconds [11.2 minutes]

> Also, please try running self-tests with the smartctl -t
> option, and send or post additional smartctl -a output when
> those tests have completed.

Will do.


  reply	other threads:[~2003-06-29 16:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-29 15:08 Testers needed: is smartmontools is 64-bit clean? Bruce Allen
2003-06-29 16:17 ` Kalle Olavi Niemitalo [this message]
2003-06-29 16:43   ` Kalle Olavi Niemitalo
2003-06-30  4:43     ` Bruce Allen
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox