summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2009-06-18 15:55:16 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2009-06-18 15:55:16 +0000
commit2bbbc8be3ecd3d1220d153b4705dc150e32114a4 (patch)
tree26931f9307782f136b150b2a38e179be07a0b2bc /sys
parentb380e7506842751982e3f676b96051678f9b9f98 (diff)
Add other valid chunk state transitions for RAID 1.
ok marco@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/softraid_raid1.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/sys/dev/softraid_raid1.c b/sys/dev/softraid_raid1.c
index 9a1195d07ef..5ff1e6d666f 100644
--- a/sys/dev/softraid_raid1.c
+++ b/sys/dev/softraid_raid1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid1.c,v 1.14 2009/06/02 21:23:11 marco Exp $ */
+/* $OpenBSD: softraid_raid1.c,v 1.15 2009/06/18 15:55:15 jsing Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
*
@@ -136,7 +136,6 @@ sr_raid1_set_chunk_state(struct sr_discipline *sd, int c, int new_state)
case BIOC_SDONLINE:
switch (new_state) {
case BIOC_SDOFFLINE:
- break;
case BIOC_SDSCRUB:
break;
default:
@@ -145,10 +144,13 @@ sr_raid1_set_chunk_state(struct sr_discipline *sd, int c, int new_state)
break;
case BIOC_SDOFFLINE:
- if (new_state == BIOC_SDREBUILD) {
- ;
- } else
+ switch (new_state) {
+ case BIOC_SDREBUILD:
+ case BIOC_SDHOTSPARE:
+ break;
+ default:
goto die;
+ }
break;
case BIOC_SDSCRUB:
@@ -159,17 +161,23 @@ sr_raid1_set_chunk_state(struct sr_discipline *sd, int c, int new_state)
break;
case BIOC_SDREBUILD:
- if (new_state == BIOC_SDONLINE) {
- ;
- } else
+ switch (new_state) {
+ case BIOC_SDONLINE:
+ case BIOC_SDOFFLINE:
+ break;
+ default:
goto die;
+ }
break;
case BIOC_SDHOTSPARE:
- if (new_state == BIOC_SDREBUILD) {
- ;
- } else
+ switch (new_state) {
+ case BIOC_SDOFFLINE:
+ case BIOC_SDREBUILD:
+ break;
+ default:
goto die;
+ }
break;
default: