diff options
| author | oster <oster@NetBSD.org> | 2002-11-17 22:41:36 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2002-11-17 22:41:36 +0000 |
| commit | 7a58f70fb2f0d11e13a149c8682442cd1d3ae76a (patch) | |
| tree | a32316577465a85ab6c9164c40c0e698b53e08fa /sys/dev/raidframe | |
| parent | aceaa7e184051e81ffde0d6cd5e76dee9705e5a9 (diff) | |
When setting root or autoconfig status, be sure to update used_spares too!
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index ce856061b30..22bbcc84cb7 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.147 2002/11/15 03:00:12 oster Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.148 2002/11/17 22:41:36 oster Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -114,7 +114,7 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.147 2002/11/15 03:00:12 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.148 2002/11/17 22:41:36 oster Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -3093,6 +3093,7 @@ rf_set_autoconfig(raidPtr, new_value) struct vnode *vp; dev_t dev; int row, column; + int sparecol; raidPtr->autoconfigure = new_value; for(row=0; row<raidPtr->numRow; row++) { @@ -3107,6 +3108,16 @@ rf_set_autoconfig(raidPtr, new_value) } } } + for(column = 0; column < raidPtr->numSpare ; column++) { + sparecol = raidPtr->numCol + column; + if (raidPtr->Disks[0][sparecol].status == rf_ds_used_spare) { + dev = raidPtr->Disks[0][sparecol].dev; + vp = raidPtr->raid_cinfo[0][sparecol].ci_vp; + raidread_component_label(dev, vp, &clabel); + clabel.autoconfigure = new_value; + raidwrite_component_label(dev, vp, &clabel); + } + } return(new_value); } @@ -3119,6 +3130,7 @@ rf_set_rootpartition(raidPtr, new_value) struct vnode *vp; dev_t dev; int row, column; + int sparecol; raidPtr->root_partition = new_value; for(row=0; row<raidPtr->numRow; row++) { @@ -3133,6 +3145,16 @@ rf_set_rootpartition(raidPtr, new_value) } } } + for(column = 0; column < raidPtr->numSpare ; column++) { + sparecol = raidPtr->numCol + column; + if (raidPtr->Disks[0][sparecol].status == rf_ds_used_spare) { + dev = raidPtr->Disks[0][sparecol].dev; + vp = raidPtr->raid_cinfo[0][sparecol].ci_vp; + raidread_component_label(dev, vp, &clabel); + clabel.root_partition = new_value; + raidwrite_component_label(dev, vp, &clabel); + } + } return(new_value); } |
