Skip to contentSkip to conversation

GFS2: Initialize hex string to '0'

PATCH New Nathan Straz 2 participants 2 messages Dec 11, 2012 – Dec 13, 2012 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 GFS2: Initialize hex string to '0'

When generating the DLM lock name, a value of 0 would skip the loop and leave the string unchanged. This left locks with a value of 0 unlabeled. Initializing the string to '0' fixes this.

---
 fs/gfs2/lock_dlm.c | 1 +
 1 file changed, 1 insertion(+)
fs/gfs2/lock_dlm.c +1 -0
index 0fb6539..a924b6a 100644
@@ -239,6 +239,7 @@ static u32 make_flags(struct gfs2_glock *gl, const unsigned int gfs_flags,
 
 static void gfs2_reverse_hex(char *c, u64 value)
 {
+	*c = '0';
 	while (value) {
 		*c-- = hex_asc[value & 0x0f];
 		value >>= 4;
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 1/1 GFS2: Initialize hex string to '0'

Hi,

Thanks for the patch - I'll put it in the tree just as soon as Linus as pulled the current set of patches,

Steve.

Quoted 19 lines · Nathan Straz

When generating the DLM lock name, a value of 0 would skip the loop and leave the string unchanged. This left locks with a value of 0 unlabeled. Initializing the string to '0' fixes this.

---
 fs/gfs2/lock_dlm.c | 1 +
 1 file changed, 1 insertion(+)
fs/gfs2/lock_dlm.c +1 -0
index 0fb6539..a924b6a 100644
@@ -239,6 +239,7 @@ static u32 make_flags(struct gfs2_glock *gl, const unsigned int gfs_flags,
 
 static void gfs2_reverse_hex(char *c, u64 value)
 {
+	*c = '0';
 	while (value) {
 		*c-- = hex_asc[value & 0x0f];
 		value >>= 4;