Thread (2 messages) 2 messages, 2 authors, 2011-12-06

[PATCH] imsm: FIX: Just created redundant array is not in uninitialized state

flat view
STALE5425d

From: Adam Kwolek <hidden>
Date: 2011-12-05 08:26:52
Subsystem: the rest · Maintainer: Linus Torvalds

When redundant array (e.g. raid5) is created metadata shows it is in
normal state. Initialization process is showed in metadata as rebuild from normal
to normal state. Redundant array should be initially in uninitialized state
before it's initialization.

Add code to put array in uninitialized state upon array creation.

Signed-off-by: Adam Kwolek <redacted>
---

 super-intel.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/super-intel.c b/super-intel.c
index a0672bf..b8abea0 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4289,7 +4289,11 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
 	map->blocks_per_member = __cpu_to_le32(info_to_blocks_per_member(info));
 	map->blocks_per_strip = __cpu_to_le16(info_to_blocks_per_strip(info));
 	map->failed_disk_num = ~0;
-	map->map_state = info->failed_disks ? IMSM_T_STATE_DEGRADED : IMSM_T_STATE_NORMAL;
+	if (info->level > 0)
+		map->map_state = IMSM_T_STATE_UNINITIALIZED;
+	else
+		map->map_state = info->failed_disks ? IMSM_T_STATE_FAILED :
+						      IMSM_T_STATE_NORMAL;
 	map->ddf = 1;
 
 	if (info->level == 1 && info->raid_disks > 2) {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help