GFS2: Initialize hex string to '0'
authorNathan Straz <nstraz@redhat.com>
Tue, 11 Dec 2012 22:01:24 +0000 (17:01 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 2 Jan 2013 10:04:00 +0000 (10:04 +0000)
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.

Signed-off-by: Nathan Straz <nstraz@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/lock_dlm.c

index 8dad6b09371660ff66d5fb17dba7c6e38bbd0d53..b906ed17a8391a99ffbc15d8ea62c6861be90689 100644 (file)
@@ -241,6 +241,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;