summaryrefslogtreecommitdiff
path: root/sys/dev/softraid_raid5.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2014-01-21 10:21:06 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2014-01-21 10:21:06 +0000
commit05d9a537c8d7c71e9a54ce621c206dbc3c6ddf67 (patch)
treed848b54007122237e7e87204e14bf9642dfac4b5 /sys/dev/softraid_raid5.c
parentcb45675595dec622231c4909689b56f0321b5414 (diff)
Add missing states to the RAID 5 volume transitions.
Diffstat (limited to 'sys/dev/softraid_raid5.c')
-rw-r--r--sys/dev/softraid_raid5.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/softraid_raid5.c b/sys/dev/softraid_raid5.c
index 31c41000ef5..121694f6564 100644
--- a/sys/dev/softraid_raid5.c
+++ b/sys/dev/softraid_raid5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid5.c,v 1.6 2014/01/21 03:15:55 jsing Exp $ */
+/* $OpenBSD: softraid_raid5.c,v 1.7 2014/01/21 10:21:05 jsing Exp $ */
/*
* Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org>
@@ -271,6 +271,7 @@ sr_raid5_set_vol_state(struct sr_discipline *sd)
case BIOC_SVONLINE:
switch (new_state) {
case BIOC_SVONLINE: /* can go to same state */
+ case BIOC_SVOFFLINE:
case BIOC_SVDEGRADED:
case BIOC_SVREBUILD: /* happens on boot */
break;
@@ -283,6 +284,17 @@ sr_raid5_set_vol_state(struct sr_discipline *sd)
/* XXX this might be a little too much */
goto die;
+ case BIOC_SVBUILDING:
+ switch (new_state) {
+ case BIOC_SVONLINE:
+ case BIOC_SVOFFLINE:
+ case BIOC_SVBUILDING: /* can go to the same state */
+ break;
+ default:
+ goto die;
+ }
+ break;
+
case BIOC_SVSCRUB:
switch (new_state) {
case BIOC_SVONLINE: