diff options
| author | oster <oster@NetBSD.org> | 2010-03-01 14:51:58 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2010-03-01 14:51:58 +0000 |
| commit | e0010cd0df2a2b74cd04fecd1d6d54e0c2f4248a (patch) | |
| tree | 57faac2c28dc5d26144a286e507c35a6ab50a65c /sys/dev/raidframe | |
| parent | eb639a8ff69fcb2e50fa48fd5d16acfa711e04f4 (diff) | |
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 (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 55bc4d26fbe..2aaa6cd7ad1 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -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 @@ void 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 @@ rf_paritymap_kern_read(RF_Raid_t *raidPtr, struct rf_paritymap_ondisk *map) 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); } |
