]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Skip clustered devices in incremental
authorGuoqing Jiang <gqjiang@suse.com>
Wed, 10 Jun 2015 05:42:10 +0000 (13:42 +0800)
committerNeilBrown <neilb@suse.de>
Tue, 16 Jun 2015 23:33:18 +0000 (09:33 +1000)
We want the clustered devices to be started exclusively by a cluster
resource-agent. So, avoid starting using the incremental option.

This also skips a clustered md from starting during boot in inactive mode.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Incremental.c
super1.c

index 0c9a9a4cd922a4586b0cc189e73c72bb2dd6d9e2..5450a5ce033b9fa36673bfc80b9eeea6c0ad869f 100644 (file)
@@ -232,6 +232,11 @@ int Incremental(struct mddev_dev *devlist, struct context *c,
                                devname);
                goto out;
        }
+       /* Skip the clustered ones. This should be started by
+        * clustering resource agents
+        */
+       if (info.array.state & (1 << MD_SB_CLUSTERED))
+               goto out;
 
        /* 3a/ if not, check for homehost match.  If no match, continue
         * but don't trust the 'name' in the array. Thus a 'random' minor
index bbb9f88a5f9d3072776f41c98864e9b797b4e782..a95c8d0cce9656658a097ce45e391dde00a77567 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -891,6 +891,8 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map)
        info->array.state =
                (__le64_to_cpu(sb->resync_offset) == MaxSector)
                ? 1 : 0;
+       if (__le32_to_cpu(bsb->nodes) > 1)
+               info->array.state |= (1 << MD_SB_CLUSTERED);
 
        info->data_offset = __le64_to_cpu(sb->data_offset);
        info->component_size = __le64_to_cpu(sb->size);