pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/29701: smartmontools 5.32 uses wrong units for SCSI timeout in os_netbsd.



>Number:         29701
>Category:       pkg
>Synopsis:       smartmontools 5.32 uses wrong units for SCSI timeout in 
>os_netbsd.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 16 00:38:00 +0000 2005
>Originator:     Scott Presnell
>Release:        NetBSD 2.0
>Organization:

Self

>Environment:

System: NetBSD low.tworoads.net 2.0 NetBSD 2.0 (YUKON) #9: Thu Dec 16 12:12:01 
PST 2004 srp%saar.tworoads.net@localhost:/usr/src/sys/arch/i386/compile/YUKON 
i386

Architecture: i386
Machine: i386
>Description:

smartctl version 5.32 Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

The package smartmontools version 5.32 uses wrong units for SCSI timeout in 
os_netbsd.c
the base code uses the expectation of a timeout in seconds, but

    ioctl(fd, SCIOCCOMMAND, &sc) in os_netbsd.c

is expecting a timeout in microseconds.

>How-To-Repeat:

Attempt "smartctl -a /dev/sd0d" from an installed smartmontools package
installation.  Note SCSI timeout :-(

>Fix:

--- os_netbsd.c.orig    2005-03-15 16:27:56.000000000 -0800
+++ os_netbsd.c 2005-03-14 11:13:34.000000000 -0800
@@ -381,7 +381,7 @@
   sc.databuf = iop->dxferp;
   sc.datalen = iop->dxfer_len;
   sc.senselen = iop->max_sense_len;
-  sc.timeout = iop->timeout == 0 ? 60000 : iop->timeout;       /* XXX */
+  sc.timeout = iop->timeout == 0 ? 60000 : (iop->timeout * 1000);/* XXX */
   sc.flags =
     (iop->dxfer_dir == DXFER_NONE ? SCCMD_READ :       /* XXX */
     (iop->dxfer_dir == DXFER_FROM_DEVICE ? SCCMD_READ : SCCMD_WRITE));




Home | Main Index | Thread Index | Old Index