File keep-bitmap-in-create-md.patch of Package drbd-utils.5899

diff -Naur drbd-utils-8.9.8.orig/user/shared/drbdmeta.c drbd-utils-8.9.8/user/shared/drbdmeta.c
--- drbd-utils-8.9.8.orig/user/shared/drbdmeta.c	2017-05-03 10:49:15.713792795 +0800
+++ drbd-utils-8.9.8/user/shared/drbdmeta.c	2017-05-03 16:34:19.746085142 +0800
@@ -3829,7 +3829,7 @@
 	int p;
 
 	for (p = 0; p < DRBD_NODE_ID_MAX; p++) {
-		cfg->md.peers[p].bitmap_uuid = 0;
+		cfg->md.peers[p].bitmap_uuid = cfg->md.peers[0].bitmap_uuid;
 		cfg->md.peers[p].flags = 0;
 		cfg->md.peers[p].bitmap_index = -1;
 	}
@@ -3857,6 +3857,18 @@
 
 void md_convert_09_to_08(struct format *cfg)
 {
+	int p;
+
+	if (cfg->md.node_id == 0) {
+		cfg->md.peers[0].bitmap_uuid = cfg->md.peers[1].bitmap_uuid;
+	}
+
+	for (p = 1; p < DRBD_NODE_ID_MAX; p++) {
+		cfg->md.peers[p].bitmap_uuid = 0;
+		cfg->md.peers[p].flags = 0;
+		cfg->md.peers[p].bitmap_index = -1;
+	}
+
 	if (cfg->md.peers[0].flags & MDF_PEER_CONNECTED)
 		cfg->md.flags |= MDF_CONNECTED_IND;
openSUSE Build Service is sponsored by