Subject: CVS commit: src/sys/dev/raidframe
To: None <source-changes@NetBSD.org>
From: Greg Oster <oster@netbsd.org>
List: source-changes
Date: 01/02/2004 21:41:08
Module Name:	src
Committed By:	oster
Date:		Fri Jan  2 21:41:08 UTC 2004

Modified Files:
	src/sys/dev/raidframe: rf_aselect.c rf_engine.c rf_raid0.c rf_raid1.c
	    rf_raid5.c rf_states.c

Log Message:
Fix the "We panic if we can't create a DAG" problem that's existed
~forever.  This requires a number of things:

1) If we can't create a DAG, set desc->numStripes to 0 in
rf_SelectAlgorithm.  This will ensure that we don't attempt to free
any dagArray[] elements in rf_StateCleanup.

2) Modify rf_State_CreateDAG() to not panic in the event of a DAG
failure.  Instead, set the bp->b_flags and bp->b_error, and set things
up to skip to rf_State_Cleanup().

3) Need to mark desc->status as "bad" so that we actually stop looking
for a different DAG.  (which we won't find... no matter how many times
we try).

4) rf_State_LastState() will then do the biodone(), and return EIO for
the IO in question.

5) Remove some " || 1 "'s from ProcessNode().  These were for
debugging, and we don't need the failure notices spewing
over and over again as the failing DAGs are processed.

6) Needed to change

       if (asmap->numDataFailed + asmap->numParityFailed > 1)

to

        if ((asmap->numDataFailed + asmap->numParityFailed > 1) ||
            (raidPtr->numFailures > 1)){

in rf_raid5.c so that it doesn't try to return
rf_CreateNonRedundantWriteDAG as the creation function.

7) Note that we can't apply the above change to the RAID 1 code as
with the silly "fake 2-D" RAID 1 sets, it is possible to have 2 failed
components in the RAID 1 set, and that would stop them from working.
(I really don't know why/how those "fake 2-D" RAID 1 sets even work
with all the "single-fault" assumptions present in the rest of the
code.)

8) Needed to protect rf_RAID0DagSelect() in a similar way -- it should
return NULL as the createFunc.

9) No point printing out "Multiple disks failed..." a zillion times.


To generate a diff of this commit:
cvs rdiff -r1.10 -r1.11 src/sys/dev/raidframe/rf_aselect.c \
    src/sys/dev/raidframe/rf_raid5.c
cvs rdiff -r1.30 -r1.31 src/sys/dev/raidframe/rf_engine.c
cvs rdiff -r1.9 -r1.10 src/sys/dev/raidframe/rf_raid0.c
cvs rdiff -r1.15 -r1.16 src/sys/dev/raidframe/rf_raid1.c
cvs rdiff -r1.24 -r1.25 src/sys/dev/raidframe/rf_states.c

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