ocfs2/dlm: fix a variable overflow problem in dlmdomain.c
authorJun Piao <piaojun@huawei.com>
Tue, 15 Mar 2016 21:53:23 +0000 (14:53 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Mar 2016 23:55:16 +0000 (16:55 -0700)
In dlm_send_join_cancels(), node is defined with type unsigned int, but
initialized with -1, this will lead variable overflow.  Although this
won't cause any runtime problem, the code looks a little uncoordinated.

Signed-off-by: Jun Piao <piaojun@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/dlm/dlmdomain.c

index c73c68efdf67a3fd2e8f00bd41903ad31d8c7ed3..12e064b8be9aff94cfe89d8bf4b60cc8eb9d6204 100644 (file)
@@ -1399,7 +1399,7 @@ static int dlm_send_join_cancels(struct dlm_ctxt *dlm,
                                 unsigned int map_size)
 {
        int status, tmpstat;
-       unsigned int node;
+       int node;
 
        if (map_size != (BITS_TO_LONGS(O2NM_MAX_NODES) *
                         sizeof(unsigned long))) {