diff options
| author | oster <oster@NetBSD.org> | 1999-08-10 01:53:26 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 1999-08-10 01:53:26 +0000 |
| commit | a531d8c31eb19b0af2632eebb2fdd05674390e71 (patch) | |
| tree | 7bd636bed59c4332f74982761732088f9363dfd6 /sys/dev/raidframe | |
| parent | 47ea8c31acdc938fe51062ab8d102a1b6f9522f3 (diff) | |
Trying to rebuild parity on a degraded set is bogus, so don't allow that.
Also, check sooner for a RAID 0 set, since rewriting parity makes no
sense there either.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_parityscan.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/raidframe/rf_parityscan.c b/sys/dev/raidframe/rf_parityscan.c index 803548e1bfb..55f61a6f7b5 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.4 1999/03/14 22:10:46 oster Exp $ */ +/* $NetBSD: rf_parityscan.c,v 1.5 1999/08/10 01:53:26 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -67,6 +67,19 @@ rf_RewriteParity(raidPtr) RF_PhysDiskAddr_t pda; RF_SectorNum_t i; + if (raidPtr->Layout.map->faultsTolerated == 0) { + /* There isn't any parity. Call it "okay." */ + return (RF_PARITY_OKAY); + } + if (raidPtr->status[0] != rf_rs_optimal) { + /* + * We're in degraded mode. Don't try to verify parity now! + * XXX: this should be a "we don't want to", not a + * "we can't" error. + */ + return (RF_PARITY_COULD_NOT_VERIFY); + } + pda.startSector = 0; pda.numSector = raidPtr->Layout.sectorsPerStripeUnit; |
