NetBSD Problem Report #40479

From zza@serpens.de  Mon Jan 26 06:37:38 2009
Return-Path: <zza@serpens.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id A2E9363BAB8
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 26 Jan 2009 06:37:38 +0000 (UTC)
Message-Id: <20090126063507.GN8770@serpens.de>
Date: Mon, 26 Jan 2009 07:35:08 +0100
From: Bernhard Moellemann <zza@serpens.de>
To: gnats-bugs@gnats.NetBSD.org
Subject: raidctl prints numBlock signed (including patch)
X-Send-Pr-Version: 3.95

>Number:         40479
>Category:       bin
>Synopsis:       raidctl prints numBlock signed
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    tron
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 26 06:40:00 +0000 2009
>Closed-Date:    Mon Feb 02 07:18:08 +0000 2009
>Last-Modified:  Mon Feb 02 07:18:08 +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);

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: bin-bug-people->tron
Responsible-Changed-By: tron@NetBSD.org
Responsible-Changed-When: Mon, 26 Jan 2009 09:03:41 +0000
Responsible-Changed-Why:
I'll handle this PR.


From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40479 CVS commit: src/sbin/raidctl
Date: Mon, 26 Jan 2009 11:34:12 +0000 (UTC)

 Module Name:	src
 Committed By:	tron
 Date:		Mon Jan 26 11:34:12 UTC 2009

 Modified Files:
 	src/sbin/raidctl: raidctl.c

 Log Message:
 Use correct format to print the "numBlocks" element in a RAIDframe
 component label. raidctl(8) should now print the correct number of
 blocks for RAID sets larger than 1TB.

 Patch supplied by Bernhard Moellemann in PR bin/40479.


 To generate a diff of this commit:
 cvs rdiff -r1.39 -r1.40 src/sbin/raidctl/raidctl.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->pending-pullups
State-Changed-By: tron@NetBSD.org
State-Changed-When: Mon, 26 Jan 2009 11:42:13 +0000
State-Changed-Why:
The fix was committed to HEAD and I've requested a pullup into the
"netbsd-5" branch.


From: Bernhard Moellemann <zza@serpens.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/40479 (raidctl prints numBlock signed)
Date: Mon, 26 Jan 2009 16:02:21 +0100

 It works:

 zza@arcanic > /usr/src/src/sbin/raidctl/raidctl -sv 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: 22
    Clean: No, Status: 0
    sectPerSU: 64, SUsPerPU: 1, SUsPerRU: 1
    Queue size: 100, blocksize: 512, numBlocks: 2930276992
    [...]

     Bernhard  //
             \X/

From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40479 CVS commit: [netbsd-3] src/sbin/raidctl
Date: Sat, 31 Jan 2009 21:24:11 +0000 (UTC)

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Jan 31 21:24:11 UTC 2009

 Modified Files:
 	src/sbin/raidctl [netbsd-3]: raidctl.c

 Log Message:
 Pull up following revision(s) (requested by tron in ticket #1989):
 	sbin/raidctl/raidctl.c: revision 1.40
 Use correct format to print the "numBlocks" element in a RAIDframe
 component label. raidctl(8) should now print the correct number of
 blocks for RAID sets larger than 1TB.
 Patch supplied by Bernhard Moellemann in PR bin/40479.


 To generate a diff of this commit:
 cvs rdiff -r1.36.2.1 -r1.36.2.2 src/sbin/raidctl/raidctl.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40479 CVS commit: [netbsd-3-1] src/sbin/raidctl
Date: Sat, 31 Jan 2009 21:26:43 +0000 (UTC)

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Jan 31 21:26:43 UTC 2009

 Modified Files:
 	src/sbin/raidctl [netbsd-3-1]: raidctl.c

 Log Message:
 Pull up following revision(s) (requested by tron in ticket #1989):
 	sbin/raidctl/raidctl.c: revision 1.40
 Use correct format to print the "numBlocks" element in a RAIDframe
 component label. raidctl(8) should now print the correct number of
 blocks for RAID sets larger than 1TB.
 Patch supplied by Bernhard Moellemann in PR bin/40479.


 To generate a diff of this commit:
 cvs rdiff -r1.36.2.1 -r1.36.2.1.4.1 src/sbin/raidctl/raidctl.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40479 CVS commit: [netbsd-3-0] src/sbin/raidctl
Date: Sat, 31 Jan 2009 21:26:47 +0000 (UTC)

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Jan 31 21:26:47 UTC 2009

 Modified Files:
 	src/sbin/raidctl [netbsd-3-0]: raidctl.c

 Log Message:
 Pull up following revision(s) (requested by tron in ticket #1989):
 	sbin/raidctl/raidctl.c: revision 1.40
 Use correct format to print the "numBlocks" element in a RAIDframe
 component label. raidctl(8) should now print the correct number of
 blocks for RAID sets larger than 1TB.
 Patch supplied by Bernhard Moellemann in PR bin/40479.


 To generate a diff of this commit:
 cvs rdiff -r1.36.2.1 -r1.36.2.1.2.1 src/sbin/raidctl/raidctl.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40479 CVS commit: [netbsd-4-0] src/sbin/raidctl
Date: Sat, 31 Jan 2009 21:55:58 +0000 (UTC)

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Jan 31 21:55:58 UTC 2009

 Modified Files:
 	src/sbin/raidctl [netbsd-4-0]: raidctl.c

 Log Message:
 Pull up following revision(s) (requested by tron in ticket #1270):
 	sbin/raidctl/raidctl.c: revision 1.40
 Use correct format to print the "numBlocks" element in a RAIDframe
 component label. raidctl(8) should now print the correct number of
 blocks for RAID sets larger than 1TB.
 Patch supplied by Bernhard Moellemann in PR bin/40479.


 To generate a diff of this commit:
 cvs rdiff -r1.38 -r1.38.16.1 src/sbin/raidctl/raidctl.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40479 CVS commit: [netbsd-4] src/sbin/raidctl
Date: Sat, 31 Jan 2009 21:56:02 +0000 (UTC)

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Jan 31 21:56:02 UTC 2009

 Modified Files:
 	src/sbin/raidctl [netbsd-4]: raidctl.c

 Log Message:
 Pull up following revision(s) (requested by tron in ticket #1270):
 	sbin/raidctl/raidctl.c: revision 1.40
 Use correct format to print the "numBlocks" element in a RAIDframe
 component label. raidctl(8) should now print the correct number of
 blocks for RAID sets larger than 1TB.
 Patch supplied by Bernhard Moellemann in PR bin/40479.


 To generate a diff of this commit:
 cvs rdiff -r1.38 -r1.38.4.1 src/sbin/raidctl/raidctl.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40479 CVS commit: [netbsd-5] src/sbin/raidctl
Date: Sun,  1 Feb 2009 23:41:38 +0000 (UTC)

 Module Name:	src
 Committed By:	snj
 Date:		Sun Feb  1 23:41:38 UTC 2009

 Modified Files:
 	src/sbin/raidctl [netbsd-5]: raidctl.c

 Log Message:
 Pull up following revision(s) (requested by tron in ticket #323):
 	sbin/raidctl/raidctl.c: revision 1.40
 Use correct format to print the "numBlocks" element in a RAIDframe
 component label. raidctl(8) should now print the correct number of
 blocks for RAID sets larger than 1TB.
 Patch supplied by Bernhard Moellemann in PR bin/40479.


 To generate a diff of this commit:
 cvs rdiff -r1.39 -r1.39.4.1 src/sbin/raidctl/raidctl.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: tron@NetBSD.org
State-Changed-When: Mon, 02 Feb 2009 07:18:08 +0000
State-Changed-Why:
All pullups have been made. Thanks a lot for the patch.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.