NetBSD-Bugs archive

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

bin/40479: raidctl prints numBlock signed (including patch)



>Number:         40479
>Category:       bin
>Synopsis:       raidctl prints numBlock signed
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 26 06:40:00 +0000 2009
>Originator:     Bernhard Moellemann
>Release:        NetBSD 5.99.6, NetBSD 5.0BETA
>Organization:
Home, sweet Home
>Environment:
System: NetBSD arcanic 5.99.6 NetBSD 5.99.6 (ARCANIC) #3: Sat Jan 10 17:36:14 
CET 2009 root@arcanic:/mnt/top/src/src/obj/sys/arch/i386/compile/ARCANIC i386
Architecture: i386
Machine: i386

>Description:
raidctl -vs prints number of blocks (which is defined as u_int in 
sys/dev/raidframe/raidframevar.h, line 444) with %d and so the
output gives a negative number for partitions with more than 2^31 blocks
on 32 bit systems

>How-To-Repeat:
Put one of those "1500 GB" drives into a raid and call raidctl -vs raid0:
zza@arcanic > dmesg
[...]
wd0 at atabus0 drive 0: <ST31500341AS>
wd0: 1397 GB, 2907021 cyl, 16 head, 63 sec, 512 bytes/sect x 2930277168 sectors
[...]

zza@arcanic > disklabel wd0d
# /dev/rwd0d:
[...]
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 2907021
total sectors: 2930277168
[...]

4 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a: 2930277104        64       RAID                     # (Cyl.    0*- 2907020)
 d: 2930277168         0     unused      0     0        # (Cyl.    0 - 2907020)

zza@arcanic > raidctl -vs raid0
Components:
           /dev/wd0a: optimal
           /dev/wd1a: optimal
           /dev/wd3a: optimal
No spares.
Component label for /dev/wd0a:
   Row: 0, Column: 0, Num Rows: 1, Num Columns: 3
   Version: 2, Serial Number: 2009012401, Mod Counter: 16
   Clean: No, Status: 0
   sectPerSU: 64, SUsPerPU: 1, SUsPerRU: 1
   Queue size: 100, blocksize: 512, numBlocks: -1364690304
   RAID Level: 5
   Autoconfig: Yes
   Root partition: No
   Last configured as: raid0
Component label for /dev/wd1a:
   [...]
   Queue size: 100, blocksize: 512, numBlocks: -1364690304
   [...]
Component label for /dev/wd3a:
   [...]
   Queue size: 100, blocksize: 512, numBlocks: -1364690304
   [...]
Parity status: DIRTY
Reconstruction is 100% complete.
Parity Re-write is 47% complete.
Copyback is 100% complete.

>Fix:
This patch fixes the issue:

*** sbin/raidctl/raidctl.c.orig Mon May  5 15:27:52 2008
--- sbin/raidctl/raidctl.c      Mon Jan 26 07:19:01 2009
*************** get_component_label(int fd, char *compon
*** 625,631 ****
        printf("   sectPerSU: %d, SUsPerPU: %d, SUsPerRU: %d\n",
               component_label.sectPerSU, component_label.SUsPerPU, 
               component_label.SUsPerRU);
!       printf("   Queue size: %d, blocksize: %d, numBlocks: %d\n",
               component_label.maxOutstanding, component_label.blockSize,
               component_label.numBlocks);
        printf("   RAID Level: %c\n", (char) component_label.parityConfig);
--- 625,631 ----
        printf("   sectPerSU: %d, SUsPerPU: %d, SUsPerRU: %d\n",
               component_label.sectPerSU, component_label.SUsPerPU, 
               component_label.SUsPerRU);
!       printf("   Queue size: %d, blocksize: %d, numBlocks: %u\n",
               component_label.maxOutstanding, component_label.blockSize,
               component_label.numBlocks);
        printf("   RAID Level: %c\n", (char) component_label.parityConfig);



Home | Main Index | Thread Index | Old Index