Skip to contentSkip to conversation

cluster/dlm/tool main.c

Cluster-devel [email protected] 1 participant 1 message Oct 17, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: teigland at sourceware.org 2007-10-17 18:10:56

Modified files:
dlm/tool : main.c

Log message:
The output of 'dlm_tool lockdump' could make it appear that a granted lock was still converting because the rqmode reported by the kernel is not reset to IV when a NOQUEUE convert fails.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm/tool/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.5&r2=1.2.2.6

dlm/tool/main.c +9 -0
@@ -372,6 +372,15 @@
 			continue;
 		}
 
+		/* A hack because dlm-kernel doesn't set rqmode back to NL when
+		   a NOQUEUE convert fails, which means in a lockdump it looks
+		   like a granted lock is still converting since rqmode is not
+		   NL.  (does it make sense to include status in the output,
+		   e.g. G,C,W?) */
+
+		if (status == DLM_LKSTS_GRANTED)
+			rqmode = DLM_LOCK_NL;
+
 		printf("id %08x gr %s rq %s pid %u master %d \"%s\"\n",
 			id, mode_str(grmode), mode_str(rqmode),
 			ownpid, nodeid, r_name);