summaryrefslogtreecommitdiff
path: root/super1.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2015-06-10 13:42:06 +0800
committerNeilBrown <neilb@suse.de>2015-06-17 09:06:30 +1000
commit7716570e6d906e7326f83d466f6ba73009649d03 (patch)
tree7107f4dec7c84e6a7f49c64e679ea0dd885a310b /super1.c
parent529e2aa573333981b211dc50ac687da7baefd224 (diff)
downloadmdadm-7716570e6d906e7326f83d466f6ba73009649d03.tar.gz
Set home-cluster while creating an array
The home-cluster is stored in the bitmap super block of the array. The device can be assembled on a cluster with the cluster name same as the one recorded in the bitmap. If home-cluster is not specified, this is auto-detected using dlopen corosync cmap library. neilb: allow code to compile when corosync-devel is not installed. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/super1.c b/super1.c
index 78d98a7..bbb9f88 100644
--- a/super1.c
+++ b/super1.c
@@ -2054,7 +2054,7 @@ add_internal_bitmap1(struct supertype *st,
bbl_size = -bbl_offset;
if (!may_change || (room < 3*2 &&
- __le32_to_cpu(sb->max_dev) <= 384)) {
+ __le32_to_cpu(sb->max_dev) <= 384)) {
room = 3*2;
offset = 1*2;
bbl_size = 0;
@@ -2145,6 +2145,9 @@ add_internal_bitmap1(struct supertype *st,
bms->sync_size = __cpu_to_le64(size);
bms->write_behind = __cpu_to_le32(write_behind);
bms->nodes = __cpu_to_le32(st->nodes);
+ if (st->cluster_name)
+ strncpy((char *)bms->cluster_name,
+ st->cluster_name, strlen(st->cluster_name));
*chunkp = chunk;
return 1;