Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Don't merge a good parity map with random ...



details:   https://anonhg.NetBSD.org/src/rev/3306097b361c
branches:  trunk
changeset: 752567:3306097b361c
user:      oster <oster%NetBSD.org@localhost>
date:      Mon Mar 01 14:51:58 2010 +0000

description:
Don't merge a good parity map with random stuff in the event that the
first component is missing.  (Since the merging just OR's the maps,
this isn't that big of a deal, as it will just over-estimate the
amount of checking that needs to be done.)

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r a400a381575d -r 3306097b361c sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Mon Mar 01 14:16:39 2010 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Mon Mar 01 14:51:58 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.271 2009/12/01 01:03:54 dyoung Exp $      */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.272 2010/03/01 14:51:58 oster Exp $       */
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -139,7 +139,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.271 2009/12/01 01:03:54 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.272 2010/03/01 14:51:58 oster Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2610,8 +2610,9 @@
 rf_paritymap_kern_read(RF_Raid_t *raidPtr, struct rf_paritymap_ondisk *map)
 {
        struct rf_paritymap_ondisk tmp;
-       int c;
-
+       int c,first;
+
+       first=1;
        for (c = 0; c < raidPtr->numCol; c++) {
                /* Skip dead disks. */
                if (RF_DEAD_DISK(raidPtr->Disks[c].status))
@@ -2620,8 +2621,9 @@
                    raidPtr->raid_cinfo[c].ci_vp, &tmp,
                    RF_PARITYMAP_NBYTE,
                    RF_PARITY_MAP_OFFSET, RF_PARITY_MAP_SIZE);
-               if (c == 0) {
+               if (first) {
                        memcpy(map, &tmp, sizeof(*map));
+                       first = 0;
                } else {
                        rf_paritymap_merge(map, &tmp);
                }



Home | Main Index | Thread Index | Old Index