NetBSD-Bugs archive

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

kern/47989: raidframe open extracs disklabel even if there are wedges



>Number:         47989
>Category:       kern
>Synopsis:       raidframe open extracs disklabel even if there are wedges
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 03 11:15:00 +0000 2013
>Originator:     Dr. Wolfgang Stukenbrock
>Release:        NetBSD 6.1
>Organization:
Dr. Nagler & Company GmbH
>Environment:
        
        
System: NetBSD test-s0 5.1.2 NetBSD 5.1.2 (NSW-WS) #3: Fri Dec 21 15:15:43 CET 
2012 wgstuken@test-s0:/usr/src/sys/arch/amd64/compile/NSW-WS amd64
Architecture: x86_64
Machine: amd64
>Description:
        In src/sys/dev/raidframe/rf_netbsdkintf.c in function raidopen() there 
is check if we have
        wedges and than validate that the open reqquest goes to the RAW 
partition, but after that
        if the devides is INITED bug has dk_openmask==0, a none existing 
disklabel is read from disk.
        Useless error messages are printed by teh kernel
>How-To-Repeat:
        setup a raid device larger then 2TB with wedges. e.g. like this:
gpt destroy wd1
gpt create -f wd1
gpt add -t raid wd1
dkctl wd1 addwedge wd1_raid 34 7814037135 raid
gpt destroy wd3
gpt create -f wd3
gpt add -t raid wd3
dkctl wd3 addwedge wd3_raid 34 7814037135 raid

-- gpt show wd1 gives now:
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34  7814037101      1  GPT part - NetBSD RAIDFrame component
  7814037135          32         Sec GPT table
  7814037167           1         Sec GPT header
-- dkctl wd1 listwedges
/dev/rwd1d: 1 wedge:
dk0: wd1_raid, 7814037101 blocks at 34, type: raid
-- dkctl wd3 listwedges
/dev/rwd3d: 1 wedge:
dk1: wd3_raid, 7814037101 blocks at 34, type: raid
---

cat - >/tmp/r1_cfg << EOF
START array
1 2 0
START disks
/dev/dk0
/dev/dk1
START layout
128 1 1 1
START queue
fifo 200
EOF

raidctl -C /tmp/r1_cfg raid1
raidctl -I 12345 raid1
raidctl -i raid1
raidctl -A yes raid1

-- you will error messages like this from when running the raidctl comands (and 
the following one ...)
raid1: WARNING: raid1: total sector size in disklabel (3519069696) != the size 
of raid (7814036992)
---

gpt create -f raid1
gpt add -i 10 -t ffs raid1
dkctl raid1 addwedge raid1_g 34 7814036925 ffs

-- gpt show raid1
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34  7814036925     10  GPT part - NetBSD FFSv1/FFSv2
  7814036959          32         Sec GPT table
  7814036991           1         Sec GPT header
-- dkctl raid1 listwedges
/dev/rraid1d: 1 wedge:
dk2: raid1_g, 7814036925 blocks at 34, type: ffs
--
newfs -O2 /dev/rdk2         
mount /dev/dk2 /mnt
....
>Fix:
        The following patch will solve the Message problem after GPT partition 
table is initialized:

--- rf_netbsdkintf.c    2013/06/11 12:39:31     1.4
+++ rf_netbsdkintf.c    2013/07/03 09:24:43
@@ -1004,7 +1004,10 @@
        }
        pmask = (1 << part);
 
-       if ((rs->sc_flags & RAIDF_INITED) &&
+
+// remark: only try to get the disklabel if we do not have wedges ....
+       if ((rs->sc_dkdev.dk_nwedges == 0) &&
+           (rs->sc_flags & RAIDF_INITED) &&
            (rs->sc_dkdev.dk_openmask == 0))
                raidgetdisklabel(dev);

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index