summaryrefslogtreecommitdiff
path: root/debian/patches/0040-Assemble-remove-the-protection-when-clustered-raid-d.patch
blob: 22c1bc83af016621b4aa29311e6b440eac1a61ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
From 80d1256e98b4995b0a753678f6c7e4a8bb369741 Mon Sep 17 00:00:00 2001
From: Guoqing Jiang <gqjiang@suse.com>
Date: Fri, 20 Jul 2018 16:05:14 +0800
Subject: [PATCH 40/40] Assemble: remove the protection when clustered raid do
 assemble

For HA product, RA (resource agent) assembles cluster raid
through call below cmd:

$MDADM --assemble $mddev --config=$RAIDCONF $MDADM_HOMEHOST

Sometimes node can't assemble array because all the nodes
need to contend dlm lock, which causes node fence in automatic
test.

And in fact, we don't need the protection since the assemble
cmd called by RA doesn't change superblock, so revert the
commit 76781701a487090172d32befae07671a10ea88ad ("Assemble:
provide protection when clustered raid do assemble") to remove
unneccessary protection.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
 Assemble.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index 0a7ab6f5..23892a37 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1348,9 +1348,6 @@ int Assemble(struct supertype *st, char *mddev,
 	char chosen_name[1024];
 	struct map_ent *map = NULL;
 	struct map_ent *mp;
-	int locked = 0;
-	struct mdp_superblock_1 *sb;
-	bitmap_super_t *bms;
 
 	/*
 	 * If any subdevs are listed, then any that don't
@@ -1381,12 +1378,6 @@ try_again:
 	 * set of devices failed.  Those are now marked as ->used==2 and
 	 * we ignore them and try again
 	 */
-	if (locked)
-		/*
-		 * if come back try_again is called, then need to unlock first,
-		 * and lock again since the metadate is re-read.
-		 */
-		cluster_release_dlmlock();
 	if (!st && ident->st)
 		st = ident->st;
 	if (c->verbose>0)
@@ -1404,14 +1395,6 @@ try_again:
 	if (!st || !st->sb || !content)
 		return 2;
 
-	sb = st->sb;
-	bms = (bitmap_super_t*)(((char*)sb) + 4096);
-	if (sb && bms->version == BITMAP_MAJOR_CLUSTERED) {
-		locked = cluster_get_dlmlock();
-		if (locked != 1)
-			return 1;
-	}
-
 	/* We have a full set of devices - we now need to find the
 	 * array device.
 	 * However there is a risk that we are racing with "mdadm -I"
@@ -1542,8 +1525,6 @@ try_again:
 		err = assemble_container_content(st, mdfd, content, c,
 						 chosen_name, NULL);
 		close(mdfd);
-		if (locked == 1)
-			cluster_release_dlmlock();
 		return err;
 	}
 
@@ -1888,8 +1869,6 @@ out:
 		close(mdfd);
 
 	/* '2' means 'OK, but not started yet' */
-	if (locked == 1)
-		cluster_release_dlmlock();
 	if (rv == -1) {
 		free(devices);
 		return 1;
-- 
2.17.1