summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-01-21 10:21:05 +0000
committerjsing <jsing@openbsd.org>2014-01-21 10:21:05 +0000
commit0e0446b0cd8ed372fab3023051786bfad6b87fee (patch)
treecbacb5f2eba46c4c38de823f5d449c571e8339b7
parentuse KERNEL_LOCK and KERNEL_UNLOCK instead of fumbling with kernel_lock (diff)
downloadwireguard-openbsd-0e0446b0cd8ed372fab3023051786bfad6b87fee.tar.xz
wireguard-openbsd-0e0446b0cd8ed372fab3023051786bfad6b87fee.zip
Add missing states to the RAID 5 volume transitions.
-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: