Subject: bin/8189: disklabel(8) and disktab(5) disagree on seek time units
To: None <gnats-bugs@gnats.netbsd.org>
From: VaX#n8 <vax@linkdead.paranoia.com>
List: netbsd-bugs
Date: 08/11/1999 00:42:17
>Number:         8189
>Category:       bin
>Synopsis:       disklabel says milliseconds, disktab says micro
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 11 00:05:00 1999
>Last-Modified:
>Originator:     VaX#n8
>Organization:
	
>Release:        1.3+
>Environment:
	

>Description:
disklabel annotates its output with a handy "milliseconds" which appears to
be in conflict with disklabel.h and disktab(5).
>How-To-Repeat:
vax@linkdead 3 bash$ disklabel sd0 | grep milli
headswitch: 0           # milliseconds
track-to-track seek: 1300       # milliseconds
$ grep usec /usr/include/sys/disklabel.h 
        u_int32_t d_headswitch;         /* head switch time, usec */
        u_int32_t d_trkseek;            /* track-to-track seek, usec */
$ grep usec /usr/share/man/cat8/diskl
disklabel.0  diskless.0   
$ grep usec /usr/share/man/cat8/diskl
disklabel.0  diskless.0   
$ grep usec /usr/share/man/cat5/disktab.0 
     hs        num      Headswitch time, usec, default 0
     ts        num      One-cylinder seek time, usec, default 0

>Fix:
Change this, if it should be "microseconds".
disklabel.c:
        (void) fprintf(f, "headswitch: %ld\t\t# milliseconds\n",
                (long) lp->d_headswitch);
        (void) fprintf(f, "track-to-track seek: %ld\t# milliseconds\n",
                (long) lp->d_trkseek);

If it should really be "milliseconds", consider the silliness of this
unit for measuring a single-track seek.

(For fun, I computed that to overflow this counter, if it were measured
in milliseconds, a drive would have a track-to-track seek of 2147483.648
seconds, or 24.8551348148 days.  Assuming linear scaling, 2000 cylinders,
and neglecting head settle time, such a drive might have an average seek
time of about 68 years.  Actually ths disklabel info calls it unsigned,
so you can effectively double that.  Now that's what I call engineering!)
>Audit-Trail:
>Unformatted: