NetBSD-Bugs archive

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

kern/39583: acrmsr(4) driver doesn't report number of volumes correctly to bioctl(8)



>Number:         39583
>Category:       kern
>Synopsis:       acrmsr(4) driver doesn't report number of volumes correctly to 
>bioctl(8)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 19 07:50:01 +0000 2008
>Originator:     Brad du Plessis
>Release:        NetBSD 4.0_STABLE
>Organization:
Cathexis Technologies
>Environment:
NetBSD massstorage 4.0_STABLE NetBSD 4.0_STABLE (GENERIC.MP) #8: Thu Sep 18 
16:46:11 SAST 2008  root@massstorage:/usr/src/sys/arch/i386/compile/GENERIC.MP 
i386

>Description:
I'm using an Areca ARC-1220:

arcmsr0 at pci2 dev 14 function 0: interrupting at ioapic0 pin 18 (irq 10)
arcmsr0: Areca ARC-1220 Host Adapter RAID controller
arcmsr0: 8 ports, 256MB SDRAM, firmware <V1.43 2007-4-17>

and I've created a single raid set with 3 volumes. My problem is that only the 
first volume is reported when doing a:

bioctl arcmsr0 show volumes


From looking at the source code in arcmsr.c, it appears that the total number 
of volumes reported to bioctl(8) will always be equal to the total number of 
raid sets. i.e. if I had 2 raid sets and 4 volumes a 'show volumes' would 
report the first 2 volumes.
>How-To-Repeat:
As above.
>Fix:
The following patch seems to address the problem, not sure if its the right 
thing to do:

Index: arcmsr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/arcmsr.c,v
retrieving revision 1.9.4.3
diff -u -r1.9.4.3 arcmsr.c
--- arcmsr.c    29 Aug 2008 21:24:19 -0000      1.9.4.3
+++ arcmsr.c    19 Sep 2008 07:43:54 -0000
@@ -1189,8 +1189,7 @@
                if (error != 0)
                        goto out;

-               if (raidinfo->volumes)
-                       nvols++;
+               nvols+=raidinfo->volumes;
        }

        strlcpy(bi->bi_dev, device_xname(&sc->sc_dev), sizeof(bi->bi_dev));



Home | Main Index | Thread Index | Old Index