NetBSD Problem Report #29540

From riz@guava.tastylime.net  Sun Feb 27 05:22:57 2005
Return-Path: <riz@guava.tastylime.net>
Received: from guava.tastylime.net (guava.tastylime.net [199.233.217.37])
	by narn.netbsd.org (Postfix) with ESMTP id 13DD263B104
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 27 Feb 2005 05:22:57 +0000 (UTC)
Message-Id: <200502270502.j1R52Gnk000378@guava.tastylime.net>
Date: Sat, 26 Feb 2005 21:02:16 -0800 (PST)
From: riz@tastylime.net
Reply-To: riz@tastylime.net
To: gnats-bugs@netbsd.org
Cc: riz@tastylime.net
Subject: raidframe can show clean parity on raid1 with a failed disk
X-Send-Pr-Version: 3.95

>Number:         29540
>Category:       kern
>Synopsis:       raidctl can show clean parity on raid1 with failed disk
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 27 05:23:00 +0000 2005
>Closed-Date:    Tue Mar 01 01:56:15 +0000 2005
>Last-Modified:  Tue Mar 01 01:56:15 +0000 2005
>Originator:     Jeff Rizzo <riz@tastylime.net>
>Release:        NetBSD 2.0_STABLE
>Organization:

>Environment:


System: NetBSD guava.tastylime.net 2.0_STABLE NetBSD 2.0_STABLE (TYAN251X.MP) #0: Wed Feb 23 11:08:08 PST 2005 riz@lychee.tastylime.net:/home/riz/buildobj/usr/src/sys/arch/i386/compile/TYAN251X.MP i386
Architecture: i386
Machine: i386
>Description:
	I've run into this before, but I had forgotten about it.

	I (purposefully) relabelled one disk of a raid1 set, and
raidframe properly told me (on console) that the raid had failed.
However, upon bootup, the parity check shows:

/dev/rraid0d: Parity status: clean

... even though raidctl -s raid0 shows:

guava# raidctl -s raid0
Components:
          component0: failed
           /dev/wd0a: optimal
No spares.
component0 status is: failed.  Skipping label.
Component label for /dev/wd0a:
   Row: 0, Column: 1, Num Rows: 1, Num Columns: 2
   Version: 2, Serial Number: 20050223, Mod Counter: 662
   Clean: No, Status: 0
   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
   Queue size: 100, blocksize: 512, numBlocks: 39102208
   RAID Level: 1
   Autoconfig: Yes
   Root partition: Yes
   Last configured as: raid0
Parity status: clean
Reconstruction is 100% complete.
Parity Re-write is 100% complete.
Copyback is 100% complete.

>How-To-Repeat:

	Build a raid1 set, calculate parity.  Then, relabel one disk,
removing the raid partition, and newfs it.  Reboot normally, and
see that parity is 'clean'.

>Fix:
	Unknown - this is probably straightforward, and one could
possibly argue that the behavior is "correct" - but it's certainly
surprising.

>Release-Note:

>Audit-Trail:
From: Greg Oster <oster@cs.usask.ca>
To: gnats-bugs@netbsd.org, netbsd-bugs@netbsd.org
Cc: riz@tastylime.net
Subject: Re: kern/29540: raidframe can show clean parity on raid1 with a failed disk 
Date: Sun, 27 Feb 2005 00:01:46 -0600

 riz@tastylime.net writes:
 > >Number:         29540
 > >Category:       kern
 > >Synopsis:       raidctl can show clean parity on raid1 with failed disk
 [snip]
 > Components:
 >           component0: failed
 >            /dev/wd0a: optimal
 [snip]
 > >How-To-Repeat:
 > 
 > 	Build a raid1 set, calculate parity.  Then, relabel one disk,
 > removing the raid partition, and newfs it.  Reboot normally, and
 > see that parity is 'clean'.
 > 
 > >Fix:
 > 	Unknown - this is probably straightforward, and one could
 > possibly argue that the behavior is "correct" - but it's certainly
 > surprising.

 The behaviour is correct.  The parity status is not dependent on 
 whether or not there is any parity present.  Another way to think 
 about "clean" is "if you end up having to read parity bits, and there 
 are parity bits, then they are known to be good".  "Dirty" means 
 "we havn't verified the parity to be good, and if you need to re
 construct something from that parity, you're on your own."  

 What the "clean" status tells you in your case is that when the RAID
 set went into degraded mode, the parity bits were in sync with the
 data bits (in RAID 1 land, that both components had the same data).  
 If it had said "dirty" instead, then that would have meant that the 
 system didn't know for sure if /dev/wd0a was in sync with component0, 
 and there possibly could be data loss (since component1 is basically 
 the "parity" for component0 in the case of a RAID 1 set).

 Perhaps an explanation of this for the man-page might be in order, 
 but the behaviour is correct..

 Later...

 Greg Oster


From: Greg Oster <oster@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/29540 CVS commit: src/sbin/raidctl
Date: Mon, 28 Feb 2005 20:37:14 +0000 (UTC)

 Module Name:	src
 Committed By:	oster
 Date:		Mon Feb 28 20:37:14 UTC 2005

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

 Log Message:
 Add a few more lines about the 'Parity status:' output of 'raidctl -s'.
 This should address PR#29540.


 To generate a diff of this commit:
 cvs rdiff -r1.47 -r1.48 src/sbin/raidctl/raidctl.8

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

State-Changed-From-To: open->closed
State-Changed-By: oster@netbsd.org
State-Changed-When: Tue, 01 Mar 2005 01:56:15 +0000
State-Changed-Why:
Behaviour is correct.  Documentation changed to hopefully explain things better.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.