]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Add recovery blocked field to mdinfo
authorAdam Kwolek <adam.kwolek@intel.com>
Wed, 5 Oct 2011 02:30:50 +0000 (13:30 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 5 Oct 2011 02:30:50 +0000 (13:30 +1100)
When container is assembled while reshape is active on one of its member
whole container can be required to be blocked from monitoring.
For such purpose field recovery blocked is added to mdinfo structure.

When metadata handler finds active reshape in container it should set
recovery_blocked field to disable whole container monitoring during
reshape.

For arrays that doesn't use containers, recovery_blocked field
has the same value as reshape_active field e.g. super0/1.
In fact,recovery is blocked during reshape for such arrays.
For ddf, metadata handler doesn't set reshape_active field,
so recovery_blocked is not set also.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c
mdadm.h
super-ddf.c
super0.c
super1.c

index afca38e6e62ef5170bd2e49e71fc0ac556b14685..4511f4d44ccc6b46e372ff1192f8bc84f32960bb 100644 (file)
@@ -1527,7 +1527,7 @@ int assemble_container_content(struct supertype *st, int mdfd,
                if (sysfs_set_array(content, md_get_version(mdfd)) != 0)
                        return 1;
 
-       if (content->reshape_active)
+       if (st->ss->external && content->recovery_blocked)
                block_subarray(content);
 
        if (sra)
diff --git a/mdadm.h b/mdadm.h
index f219c959c73915b85fb205f8603d832d9bb63297..c397045fbdb96f0347892abf6f9666aeeeb15fc0 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -196,6 +196,13 @@ struct mdinfo {
                                                    */
        int                     reshape_active;
        unsigned long long      reshape_progress;
+       int                     recovery_blocked; /* for external metadata it
+                                                  * indicates that there is
+                                                  * reshape in progress in
+                                                  * container,
+                                                  * for native metadata it is
+                                                  * reshape_active field mirror
+                                                  */
        union {
                unsigned long long resync_start; /* per-array resync position */
                unsigned long long recovery_start; /* per-device rebuild position */
index 7312ba4b012a92c2e696182ae7fc33b4d7f03c03..d3f8b2935c8215fd12702d573da76bfc22fd278f 100644 (file)
@@ -1374,6 +1374,7 @@ static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info, char *m
 
        info->recovery_start = MaxSector;
        info->reshape_active = 0;
+       info->recovery_blocked = 0;
        info->name[0] = 0;
 
        info->array.major_version = -1;
@@ -1449,6 +1450,7 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, cha
        info->recovery_start = MaxSector;
        info->resync_start = 0;
        info->reshape_active = 0;
+       info->recovery_blocked = 0;
        if (!(ddf->virt->entries[info->container_member].state
              & DDF_state_inconsistent)  &&
            (ddf->virt->entries[info->container_member].init_state
index f791e9d713841eefe121eb75af9ef7697769f9c4..3061ecfe76f41b7e21e3f36a75866f6502114ad8 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -387,6 +387,8 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info, char *map)
        } else
                info->reshape_active = 0;
 
+       info->recovery_blocked = info->reshape_active;
+
        sprintf(info->name, "%d", sb->md_minor);
        /* work_disks is calculated rather than read directly */
        for (i=0; i < MD_SB_DISKS; i++)
index 0cd412400a2fd49824c0ac12cdca15e5759466ac..9a72681ff13dfce1af896fa57fe30ef7f6ca2396 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -626,6 +626,8 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map)
        } else
                info->reshape_active = 0;
 
+       info->recovery_blocked = info->reshape_active;
+
        if (map)
                for (i=0; i<map_disks; i++)
                        map[i] = 0;