]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Detail.c
mdadm: Introduce new array state 'broken' for raid0/linear
[thirdparty/mdadm.git] / Detail.c
index ad60434f0aaeedbff681dc8622843fe9c390d724..3e61e372fe9f16b6c1897afb693dd016ec3f516a 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -81,6 +81,7 @@ int Detail(char *dev, struct context *c)
        int external;
        int inactive;
        int is_container = 0;
+       char *arrayst;
 
        if (fd < 0) {
                pr_err("cannot open %s: %s\n",
@@ -485,9 +486,18 @@ int Detail(char *dev, struct context *c)
                        else
                                st = ", degraded";
 
+                       if (array.state & (1 << MD_SB_CLEAN)) {
+                               if ((array.level == 0) ||
+                                   (array.level == LEVEL_LINEAR))
+                                       arrayst = map_num(sysfs_array_states,
+                                                         sra->array_state);
+                               else
+                                       arrayst = "clean";
+                       } else
+                               arrayst = "active";
+
                        printf("             State : %s%s%s%s%s%s \n",
-                              (array.state & (1 << MD_SB_CLEAN)) ?
-                              "clean" : "active", st,
+                              arrayst, st,
                               (!e || (e->percent < 0 &&
                                       e->percent != RESYNC_PENDING &&
                                       e->percent != RESYNC_DELAYED)) ?