Skip to contentSkip to conversation

LVM2/daemons/clvmd lvm-functions.c

PATCH [email protected] 2 participants 2 messages Nov 29, 2010

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2010-11-29 11:05:15

Modified files:
daemons/clvmd : lvm-functions.c

Log message:
Remove printing of LCK_CACHE

LCK_CACHE is defined as 0x100 so it cannot be passed through unsigned char parameter - remove it from the sprintf code.

If the LCK_CLUSTER should be printed here - lot of code need to be reworked - so adding FIXME comment.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.100&r2=1.101

daemons/clvmd/lvm-functions.c +6 -3
@@ -44,6 +44,10 @@
 	int lock_mode;
 };
 
+/*
+ * FIXME: 8bit value passed here -
+ *        so only LCK_XXX defines < 0x100 can be decoded
+ */
 static const char *decode_locking_cmd(unsigned char cmdl)
 {
 	static char buf[128];
@@ -109,12 +113,11 @@
 		break;
 	}
 
-	sprintf(buf, "0x%x %s (%s|%s%s%s%s%s%s)", cmdl, command, type, scope,
+	sprintf(buf, "0x%x %s (%s|%s%s%s%s%s)", cmdl, command, type, scope,
 		cmdl & LCK_NONBLOCK   ? "|NONBLOCK" : "",
 		cmdl & LCK_HOLD       ? "|HOLD" : "",
 		cmdl & LCK_LOCAL      ? "|LOCAL" : "",
-		cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "",
-		cmdl & LCK_CACHE      ? "|CACHE" : "");
+		cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "");
 
 	return buf;
 }
#1 lore raw
Quoted 1 line · zkabelac at sourceware.org

Remove printing of LCK_CACHE

But straightforward to fix so it still gets printed (somewhere)?

Quoted 2 lines

If the LCK_CLUSTER should be printed here - lot of code need to be reworked - so adding FIXME comment.

With code like:
(lock_flags & LCK_CLUSTER_VG)
LCK_CLUSTER_VG (I presume you meant) should it be handled by decode_flags?

Quoted 2 lines

+ * FIXME: 8bit value passed here -
+ * so only LCK_XXX defines < 0x100 can be decoded

(Not really the thing to fix.)

Alasdair