diff options
| author | oster <oster@NetBSD.org> | 2004-11-17 01:34:10 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2004-11-17 01:34:10 +0000 |
| commit | 1f113cb32a47282c5ee535a6aeb4da65fd669c50 (patch) | |
| tree | ac44db0529308d4bf4dd6aed78aeb2f5e72a8d09 /sys/dev/raidframe | |
| parent | c7dab32bb370b412910ded5f20d97ee872584fea (diff) | |
Don't allow -f to fail a disk while a reconstruction is taking place
since that would cause a panic. (Problem noticed by dan@.)
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index a33a6f17bf7..5490b8a6ec5 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.184 2004/11/16 16:52:30 oster Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.185 2004/11/17 01:34:10 oster Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -146,7 +146,7 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.184 2004/11/16 16:52:30 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.185 2004/11/17 01:34:10 oster Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -1285,6 +1285,12 @@ raidioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) RF_LOCK_MUTEX(raidPtr->mutex); + if (raidPtr->status == rf_rs_reconstructing) { + /* you can't fail a disk while we're reconstructing! */ + /* XXX wrong for RAID6 */ + RF_UNLOCK_MUTEX(raidPtr->mutex); + return (EINVAL); + } if ((raidPtr->Disks[rr->col].status == rf_ds_optimal) && (raidPtr->numFailures > 0)) { /* some other component has failed. Let's not make |
