summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>1999-08-10 22:19:27 +0000
committeroster <oster@NetBSD.org>1999-08-10 22:19:27 +0000
commit0b08c839eb5986aeb1a6032cef9c0edbee68a5f7 (patch)
tree94588a8f53f5baec9a3b65d829667c4b26b977f3 /sys/dev/raidframe
parentead3c28a8d1391663951f13f1793cfe79da98cbd (diff)
Don't go ape if there is a problem verifying the parity. Note the condition
and inform the user (as opposed to panicing the system!).
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_parityscan.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/dev/raidframe/rf_parityscan.c b/sys/dev/raidframe/rf_parityscan.c
index 55f61a6f7b5..f57147a8a46 100644
--- a/sys/dev/raidframe/rf_parityscan.c
+++ b/sys/dev/raidframe/rf_parityscan.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_parityscan.c,v 1.5 1999/08/10 01:53:26 oster Exp $ */
+/* $NetBSD: rf_parityscan.c,v 1.6 1999/08/10 22:19:27 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -63,6 +63,7 @@ rf_RewriteParity(raidPtr)
{
RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
RF_AccessStripeMapHeader_t *asm_h;
+ int ret_val;
int rc;
RF_PhysDiskAddr_t pda;
RF_SectorNum_t i;
@@ -80,10 +81,14 @@ rf_RewriteParity(raidPtr)
return (RF_PARITY_COULD_NOT_VERIFY);
}
+ ret_val = 0;
+
pda.startSector = 0;
pda.numSector = raidPtr->Layout.sectorsPerStripeUnit;
+ rc = RF_PARITY_OKAY;
- for (i = 0; i < raidPtr->totalSectors;
+ for (i = 0; i < raidPtr->totalSectors &&
+ rc <= RF_PARITY_CORRECTED;
i += layoutPtr->dataSectorsPerStripe) {
asm_h = rf_MapAccess(raidPtr, i,
layoutPtr->dataSectorsPerStripe,
@@ -97,23 +102,23 @@ rf_RewriteParity(raidPtr)
break;
case RF_PARITY_BAD:
printf("Parity bad during correction\n");
- RF_PANIC();
+ ret_val = 1;
break;
case RF_PARITY_COULD_NOT_CORRECT:
printf("Could not correct bad parity\n");
- RF_PANIC();
+ ret_val = 1;
break;
case RF_PARITY_COULD_NOT_VERIFY:
printf("Could not verify parity\n");
- RF_PANIC();
+ ret_val = 1;
break;
default:
printf("Bad rc=%d from VerifyParity in RewriteParity\n", rc);
- RF_PANIC();
+ ret_val = 1;
}
rf_FreeAccessStripeMap(asm_h);
}
- return (0);
+ return (ret_val);
}
/*****************************************************************************************
*