Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/raidframe Pullup 1.98 [oster]:



details:   https://anonhg.NetBSD.org/src/rev/bf5a0d2538d1
branches:  netbsd-1-5
changeset: 489877:bf5a0d2538d1
user:      tv <tv%NetBSD.org@localhost>
date:      Wed Oct 18 02:45:41 2000 +0000

description:
Pullup 1.98 [oster]:
Don't touch a failed component at all.  Thanks to Robert Elz (kre) for
noting the problem and providing additional comments.

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (42 lines):

diff -r d956414ca871 -r bf5a0d2538d1 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Wed Oct 18 02:27:44 2000 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Wed Oct 18 02:45:41 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.92.2.5 2000/10/17 20:11:47 tv Exp $       */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.92.2.6 2000/10/18 02:45:41 tv Exp $       */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -1059,7 +1059,7 @@
                        ci_label.row = row;
                        for(column=0;column<raidPtr->numCol;column++) {
                                diskPtr = &raidPtr->Disks[row][column];
-                               if (diskPtr->status != rf_ds_failed) {
+                               if (!RF_DEAD_DISK(diskPtr->status)) {
                                        ci_label.partitionSize = diskPtr->partitionSize;
                                        ci_label.column = column;
                                        raidwrite_component_label( 
@@ -2167,6 +2167,12 @@
        /* XXX should probably ensure that we don't try to do this if
           someone has changed rf_protected_sectors. */ 
 
+       if (b_vp == NULL) {
+               /* For whatever reason, this component is not valid.
+                  Don't try to read a component label from it. */
+               return(EINVAL);
+       }
+
        /* get a block of the appropriate size... */
        bp = geteblk((int)RF_COMPONENT_INFO_SIZE);
        bp->b_dev = dev;
@@ -2244,7 +2250,9 @@
        raidPtr->mod_counter++;
        for (r = 0; r < raidPtr->numRow; r++) {
                for (c = 0; c < raidPtr->numCol; c++) {
-                       if (raidPtr->Disks[r][c].status != rf_ds_failed) {
+                       /* we don't want to touch (at all) a disk that has
+                          failed */
+                       if (!RF_DEAD_DISK(raidPtr->Disks[r][c].status)) {
                                raidread_component_label(
                                        raidPtr->Disks[r][c].dev,
                                        raidPtr->raid_cinfo[r][c].ci_vp,



Home | Main Index | Thread Index | Old Index