summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>1999-12-09 02:26:09 +0000
committeroster <oster@NetBSD.org>1999-12-09 02:26:09 +0000
commita0d72cb555f2f1d3863baee73d26ea1bd12113c9 (patch)
tree288d4e84e3ca7cdb8b54eab2d16aa909c53e4944 /sys/dev
parent4765859db3643d303da0624ede563e06d8610684 (diff)
Trust only the data disk if the mirror is not known to be up-to-date.
(this should have been committed with a previous fix for the same problem in another function in this file :( )
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/raidframe/rf_dagutils.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/raidframe/rf_dagutils.c b/sys/dev/raidframe/rf_dagutils.c
index a8562f3ad83..342420f2ce8 100644
--- a/sys/dev/raidframe/rf_dagutils.c
+++ b/sys/dev/raidframe/rf_dagutils.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_dagutils.c,v 1.5 1999/11/09 03:07:20 oster Exp $ */
+/* $NetBSD: rf_dagutils.c,v 1.6 1999/12/09 02:26:09 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -1273,12 +1273,17 @@ rf_SelectMirrorDiskPartition(RF_DagNode_t * node)
} else
if (RF_DEAD_DISK(disks[rowData][colData].status)) {
usemirror = 1;
- } else
- if (data_pda->startSector < (disks[rowData][colData].numBlocks / 2)) {
+ } else
+ if (raidPtr->parity_good == RF_RAID_DIRTY) {
+ /* Trust only the main disk */
usemirror = 0;
- } else {
- usemirror = 1;
- }
+ } else
+ if (data_pda->startSector <
+ (disks[rowData][colData].numBlocks / 2)) {
+ usemirror = 0;
+ } else {
+ usemirror = 1;
+ }
if (usemirror) {
/* use mirror (parity) disk, swap params 0 & 4 */