All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2/dlm: fix a variable overflow problem in dlmdomain.c
@ 2016-03-14 11:57 piaojun
  2016-03-14 12:21 ` Joseph Qi
  0 siblings, 1 reply; 3+ messages in thread
From: piaojun @ 2016-03-14 11:57 UTC (permalink / raw)
  To: ocfs2-devel

In dlm_send_join_cancels(), unsigned int node is assigned -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>
---
 dlm/dlmdomain.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dlm/dlmdomain.c b/dlm/dlmdomain.c
index 2ee7fe7..61bafa7 100644
--- a/dlm/dlmdomain.c
+++ b/dlm/dlmdomain.c
@@ -1395,8 +1395,7 @@ static int dlm_send_join_cancels(struct dlm_ctxt *dlm,
 				 unsigned long *node_map,
 				 unsigned int map_size)
 {
-	int status, tmpstat;
-	unsigned int node;
+	int status, tmpstat, int node;

 	if (map_size != (BITS_TO_LONGS(O2NM_MAX_NODES) *
 			 sizeof(unsigned long))) {
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/dlm: fix a variable overflow problem in dlmdomain.c
  2016-03-14 11:57 [Ocfs2-devel] [PATCH] ocfs2/dlm: fix a variable overflow problem in dlmdomain.c piaojun
@ 2016-03-14 12:21 ` Joseph Qi
  2016-03-14 12:44   ` piaojun
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Qi @ 2016-03-14 12:21 UTC (permalink / raw)
  To: ocfs2-devel

On 2016/3/14 19:57, piaojun wrote:
> In dlm_send_join_cancels(), unsigned int node is assigned -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>
> ---
>  dlm/dlmdomain.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/dlm/dlmdomain.c b/dlm/dlmdomain.c
> index 2ee7fe7..61bafa7 100644
> --- a/dlm/dlmdomain.c
> +++ b/dlm/dlmdomain.c
> @@ -1395,8 +1395,7 @@ static int dlm_send_join_cancels(struct dlm_ctxt *dlm,
>  				 unsigned long *node_map,
>  				 unsigned int map_size)
>  {
> -	int status, tmpstat;
> -	unsigned int node;
> +	int status, tmpstat, int node;
This is not right. NAK.

> 
>  	if (map_size != (BITS_TO_LONGS(O2NM_MAX_NODES) *
>  			 sizeof(unsigned long))) {
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/dlm: fix a variable overflow problem in dlmdomain.c
  2016-03-14 12:21 ` Joseph Qi
@ 2016-03-14 12:44   ` piaojun
  0 siblings, 0 replies; 3+ messages in thread
From: piaojun @ 2016-03-14 12:44 UTC (permalink / raw)
  To: ocfs2-devel



On 2016/3/14 20:21, Joseph Qi wrote:
> On 2016/3/14 19:57, piaojun wrote:
>> In dlm_send_join_cancels(), unsigned int node is assigned -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>
>> ---
>>  dlm/dlmdomain.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/dlm/dlmdomain.c b/dlm/dlmdomain.c
>> index 2ee7fe7..61bafa7 100644
>> --- a/dlm/dlmdomain.c
>> +++ b/dlm/dlmdomain.c
>> @@ -1395,8 +1395,7 @@ static int dlm_send_join_cancels(struct dlm_ctxt *dlm,
>>  				 unsigned long *node_map,
>>  				 unsigned int map_size)
>>  {
>> -	int status, tmpstat;
>> -	unsigned int node;
>> +	int status, tmpstat, int node;
> This is not right. NAK.
> 
Hi Joseph Qi, Thanks for your prompt, I have sent a V2 patch to fix this.
>>
>>  	if (map_size != (BITS_TO_LONGS(O2NM_MAX_NODES) *
>>  			 sizeof(unsigned long))) {
>>
> 
> 
> 
> .
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-14 12:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-14 11:57 [Ocfs2-devel] [PATCH] ocfs2/dlm: fix a variable overflow problem in dlmdomain.c piaojun
2016-03-14 12:21 ` Joseph Qi
2016-03-14 12:44   ` piaojun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.