Skip to contentSkip to conversation

Call dlm_release_lockspace with force=1 in clvmd-corosync.c

linux-lvm Xinwei Hu 2 participants 2 messages Apr 1, 2009

lore
Share & tools
lore

Xinwei Hu

author
#0 lore raw

Hi all,

All calls to dlm_release_lockspace in clvmd-corosync.c use
force=0. This may cause the problem when
the node is the "lock master" of lockspace, the lockspace won't be release then, and there'll be no any error
information from libdlm.

Issues' found and analysied by Lars Marowsky-Bree and David Teigland.

The patch tries to call dlm_release_lockspace with force = 1 in all cases.

Please consider it for inclusion.

Thanks.

clvmd-corosync.c +7 -3
Index: clvmd/clvmd-corosync.c
===================================================================
@@ -334,7 +334,7 @@
 	if (err != CS_OK) {
 		cpg_finalize(cpg_handle);
 		quorum_finalize(quorum_handle);
-		dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0);
+		dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1);
 		syslog(LOG_ERR, "Cannot join clvmd process group");
 		DEBUGLOG("Cannot join clvmd process group: %d\n", err);
 		return cs_to_errno(err);
@@ -345,7 +345,7 @@
 	if (err != CS_OK) {
 		cpg_finalize(cpg_handle);
 		quorum_finalize(quorum_handle);
-		dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0);
+		dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1);
 		syslog(LOG_ERR, "Cannot get local node id\n");
 		return cs_to_errno(err);
 	}
@@ -361,7 +361,11 @@
 	DEBUGLOG("cluster_closedown\n");
 	unlock_all();
 
-	dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 0);
+	/* The first node is the lock master.
+	   Unless call dlm_release_lockspace with force=1, the node
+	   master can't release the lockspace, and no error will
+	   be returned by dlm_release_lockspace in this case. */
+	dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1);
 	cpg_finalize(cpg_handle);
 	quorum_finalize(quorum_handle);
 }
#1 lore raw
Quoted 8 lines · Xinwei Hu

Hi all,

All calls to dlm_release_lockspace in clvmd-corosync.c use
force=0. This may cause the problem when
the node is the "lock master" of lockspace, the lockspace won't be release then, and there'll be no any error
information from libdlm.

Quoted 5 lines

Issues' found and analysied by Lars Marowsky-Bree and David Teigland.

The patch tries to call dlm_release_lockspace with force = 1 in all cases.

Please consider it for inclusion.

You're right (as usual). Force should also be set to 1 for consistency with clvmd-cman.

The patch is now in CVS

Thank you.

Chrissie