[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120104071931.GC30978@elgon.mountain>
Date: Wed, 4 Jan 2012 10:19:31 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Steven Whitehouse <swhiteho@...hat.com>,
David Teigland <teigland@...hat.com>
Cc: cluster-devel@...hat.com, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] gfs2: make some sizes unsigned in set_recover_size()
ls->ls_recover_size is uint32_t so old_size and new_size should be
unsigned as well. Otherwise a large value could count as a negative
and we could get past the "if (old_size >= max_jid + 1)" check by
mistake.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index 82c82d0..400d041 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -886,7 +886,8 @@ static int set_recover_size(struct gfs2_sbd *sdp, struct dlm_slot *slots,
struct lm_lockstruct *ls = &sdp->sd_lockstruct;
uint32_t *submit = NULL;
uint32_t *result = NULL;
- int i, max_jid, old_size, new_size;
+ uint32_t old_size, new_size;
+ int i, max_jid;
max_jid = 0;
for (i = 0; i < num_slots; i++) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists