public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ubifs: correct the size of nnode in memset
@ 2015-08-19  8:28 Dongsheng Yang
  2015-08-19 16:29 ` Brian Norris
  0 siblings, 1 reply; 3+ messages in thread
From: Dongsheng Yang @ 2015-08-19  8:28 UTC (permalink / raw)
  To: richard, dedekind1, computersforpeace; +Cc: linux-mtd, Dongsheng Yang

There is a typo in lpt to memset nnode by the
size in sizeof(stuct ubifs_pnode).

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
 mkfs.ubifs/lpt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs.ubifs/lpt.c b/mkfs.ubifs/lpt.c
index f6d4352..6aa0b88 100644
--- a/mkfs.ubifs/lpt.c
+++ b/mkfs.ubifs/lpt.c
@@ -384,7 +384,7 @@ int create_lpt(struct ubifs_info *c)
 		goto out;
 	}
 	memset(pnode, 0 , sizeof(struct ubifs_pnode));
-	memset(nnode, 0 , sizeof(struct ubifs_pnode));
+	memset(nnode, 0 , sizeof(struct ubifs_nnode));
 
 	c->lscan_lnum = c->main_first;
 
-- 
1.8.4.2

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

* Re: [PATCH] ubifs: correct the size of nnode in memset
  2015-08-19  8:28 [PATCH] ubifs: correct the size of nnode in memset Dongsheng Yang
@ 2015-08-19 16:29 ` Brian Norris
  2015-08-20  3:06   ` Dongsheng Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Norris @ 2015-08-19 16:29 UTC (permalink / raw)
  To: Dongsheng Yang; +Cc: richard, dedekind1, linux-mtd

On Wed, Aug 19, 2015 at 04:28:52PM +0800, Dongsheng Yang wrote:
> There is a typo in lpt to memset nnode by the
> size in sizeof(stuct ubifs_pnode).
> 
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>

Pushed to mtd-utils.git, as it's obvious. Good catch!

I'll take a look at your restructuring patches eventually. But I'll
usually just defer UBIFS stuff to Richard/Artem/others.

> ---
>  mkfs.ubifs/lpt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mkfs.ubifs/lpt.c b/mkfs.ubifs/lpt.c
> index f6d4352..6aa0b88 100644
> --- a/mkfs.ubifs/lpt.c
> +++ b/mkfs.ubifs/lpt.c
> @@ -384,7 +384,7 @@ int create_lpt(struct ubifs_info *c)
>  		goto out;
>  	}
>  	memset(pnode, 0 , sizeof(struct ubifs_pnode));
> -	memset(nnode, 0 , sizeof(struct ubifs_pnode));
> +	memset(nnode, 0 , sizeof(struct ubifs_nnode));

FWIW, struct ubifs_pnode and struct ubifs_nnode look like they would be
the same size when using 32-bit pointers, but a bit different (see the
third field in structs ubifs_nbranch and ubifs_lprops) with 64-bit.

>  
>  	c->lscan_lnum = c->main_first;
>  
> -- 
> 1.8.4.2

Brian

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

* Re: [PATCH] ubifs: correct the size of nnode in memset
  2015-08-19 16:29 ` Brian Norris
@ 2015-08-20  3:06   ` Dongsheng Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Dongsheng Yang @ 2015-08-20  3:06 UTC (permalink / raw)
  To: Brian Norris; +Cc: richard, dedekind1, linux-mtd

On 08/20/2015 12:29 AM, Brian Norris wrote:
> On Wed, Aug 19, 2015 at 04:28:52PM +0800, Dongsheng Yang wrote:
>> There is a typo in lpt to memset nnode by the
>> size in sizeof(stuct ubifs_pnode).
>>
>> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
>
> Pushed to mtd-utils.git, as it's obvious. Good catch!
>
> I'll take a look at your restructuring patches eventually. But I'll
> usually just defer UBIFS stuff to Richard/Artem/others.

Great, thanx a lot, Brian.
>
>> ---
>>   mkfs.ubifs/lpt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mkfs.ubifs/lpt.c b/mkfs.ubifs/lpt.c
>> index f6d4352..6aa0b88 100644
>> --- a/mkfs.ubifs/lpt.c
>> +++ b/mkfs.ubifs/lpt.c
>> @@ -384,7 +384,7 @@ int create_lpt(struct ubifs_info *c)
>>   		goto out;
>>   	}
>>   	memset(pnode, 0 , sizeof(struct ubifs_pnode));
>> -	memset(nnode, 0 , sizeof(struct ubifs_pnode));
>> +	memset(nnode, 0 , sizeof(struct ubifs_nnode));
>
> FWIW, struct ubifs_pnode and struct ubifs_nnode look like they would be
> the same size when using 32-bit pointers, but a bit different (see the
> third field in structs ubifs_nbranch and ubifs_lprops) with 64-bit.

Yes, but in the latest ubifs.h in kernel, they are more different. And
when I updated the ubifs.h, I found the bug.

Thanx
Yang
>
>>
>>   	c->lscan_lnum = c->main_first;
>>
>> --
>> 1.8.4.2
>
> Brian
> .
>

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

end of thread, other threads:[~2015-08-20  3:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-19  8:28 [PATCH] ubifs: correct the size of nnode in memset Dongsheng Yang
2015-08-19 16:29 ` Brian Norris
2015-08-20  3:06   ` Dongsheng Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox