Module Name: src Committed By: oster Date: Mon Mar 1 14:51:58 UTC 2010
Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: 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.) To generate a diff of this commit: cvs rdiff -u -r1.271 -r1.272 src/sys/dev/raidframe/rf_netbsdkintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/raidframe/rf_netbsdkintf.c diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.271 src/sys/dev/raidframe/rf_netbsdkintf.c:1.272 --- src/sys/dev/raidframe/rf_netbsdkintf.c:1.271 Tue Dec 1 01:03:54 2009 +++ src/sys/dev/raidframe/rf_netbsdkintf.c Mon Mar 1 14:51:58 2010 @@ -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); }