summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJordan Hargrave <jordan@cvs.openbsd.org>2009-08-04 20:17:15 +0000
committerJordan Hargrave <jordan@cvs.openbsd.org>2009-08-04 20:17:15 +0000
commit50c0c504007b854a4d752f7b01726e35f9f34156 (patch)
tree961959716f5c1f3644b827bad8cd49e0b2603d2f /sys/dev
parent7a3a16a1a009b7dd7ae6b8e80e7dc0d1642b5aff (diff)
Fix volume state transitions for RAID4/5/6
ok marco@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/softraid_raid6.c6
-rw-r--r--sys/dev/softraid_raidp.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/softraid_raid6.c b/sys/dev/softraid_raid6.c
index 1ac910993c9..2e60630973f 100644
--- a/sys/dev/softraid_raid6.c
+++ b/sys/dev/softraid_raid6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid6.c,v 1.1 2009/07/23 15:15:26 jordan Exp $ */
+/* $OpenBSD: softraid_raid6.c,v 1.2 2009/08/04 20:17:14 jordan Exp $ */
/*
* Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org>
@@ -268,12 +268,12 @@ sr_raid6_set_vol_state(struct sr_discipline *sd)
new_state = BIOC_SVONLINE;
else if (states[BIOC_SDONLINE] < nd - 2)
new_state = BIOC_SVOFFLINE;
- else if (states[BIOC_SDOFFLINE] == nd - 2)
- new_state = BIOC_SVDEGRADED;
else if (states[BIOC_SDSCRUB] != 0)
new_state = BIOC_SVSCRUB;
else if (states[BIOC_SDREBUILD] != 0)
new_state = BIOC_SVREBUILD;
+ else if (states[BIOC_SDONLINE] < nd)
+ new_state = BIOC_SVDEGRADED;
else {
printf("old_state = %d, ", old_state);
for (i = 0; i < nd; i++)
diff --git a/sys/dev/softraid_raidp.c b/sys/dev/softraid_raidp.c
index 1a23669a4c9..848db4d7413 100644
--- a/sys/dev/softraid_raidp.c
+++ b/sys/dev/softraid_raidp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raidp.c,v 1.8 2009/07/31 15:30:35 jsing Exp $ */
+/* $OpenBSD: softraid_raidp.c,v 1.9 2009/08/04 20:17:14 jordan Exp $ */
/*
* Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org>
@@ -242,14 +242,14 @@ sr_raidp_set_vol_state(struct sr_discipline *sd)
if (states[BIOC_SDONLINE] == nd)
new_state = BIOC_SVONLINE;
- else if (states[BIOC_SDONLINE] == nd - 1)
- new_state = BIOC_SVDEGRADED;
else if (states[BIOC_SDONLINE] < nd - 1)
new_state = BIOC_SVOFFLINE;
else if (states[BIOC_SDSCRUB] != 0)
new_state = BIOC_SVSCRUB;
else if (states[BIOC_SDREBUILD] != 0)
new_state = BIOC_SVREBUILD;
+ else if (states[BIOC_SDONLINE] == nd - 1)
+ new_state = BIOC_SVDEGRADED;
else {
#ifdef SR_DEBUG
DNPRINTF(SR_D_STATE, "%s: invalid volume state, old state "