linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Call dlm_release_lockspace with force=1 in clvmd-corosync.c
@ 2009-04-01  2:11 Xinwei Hu
  2009-04-01  7:52 ` Chrissie Caulfield
  0 siblings, 1 reply; 2+ messages in thread
From: Xinwei Hu @ 2009-04-01  2:11 UTC (permalink / raw)
  To: LVM general discussion and development

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

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.

[-- Attachment #2: dlm_release_lockspace_with_force.diff --]
[-- Type: text/x-patch, Size: 1358 bytes --]

Index: clvmd/clvmd-corosync.c
===================================================================
--- clvmd.orig/clvmd-corosync.c	2009-03-10 16:47:15.000000000 +0800
+++ clvmd/clvmd-corosync.c	2009-04-01 10:10:37.000000000 +0800
@@ -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);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-lvm] Call dlm_release_lockspace with force=1 in clvmd-corosync.c
  2009-04-01  2:11 [linux-lvm] Call dlm_release_lockspace with force=1 in clvmd-corosync.c Xinwei Hu
@ 2009-04-01  7:52 ` Chrissie Caulfield
  0 siblings, 0 replies; 2+ messages in thread
From: Chrissie Caulfield @ 2009-04-01  7:52 UTC (permalink / raw)
  To: linux-lvm

Xinwei Hu wrote:
> 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.


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-01  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-01  2:11 [linux-lvm] Call dlm_release_lockspace with force=1 in clvmd-corosync.c Xinwei Hu
2009-04-01  7:52 ` Chrissie Caulfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).