linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] erofs-utils: remove unnecessary "\n"
@ 2021-09-06  8:13 Huang Jianan via Linux-erofs
  2021-09-06  8:13 ` [PATCH] uerofs-utils: fix random data for block-aligned uncompressed file Huang Jianan via Linux-erofs
  2021-09-07  0:08 ` [PATCH] erofs-utils: remove unnecessary "\n" Gao Xiang
  0 siblings, 2 replies; 9+ messages in thread
From: Huang Jianan via Linux-erofs @ 2021-09-06  8:13 UTC (permalink / raw)
  To: linux-erofs; +Cc: yh, kevin.liw, guoweichao, guanyuwei

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
---
 lib/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/inode.c b/lib/inode.c
index 5bad75e..0ad703d 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -744,7 +744,7 @@ int erofs_droid_inode_fsconfig(struct erofs_inode *inode,
 			  cfg.target_out_path,
 			  &uid, &gid, &mode, &inode->capabilities);
 
-	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, capabilities = 0x%" PRIx64 "\n",
+	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, capabilities = 0x%" PRIx64,
 		  fspath, mode, uid, gid, inode->capabilities);
 
 	if (decorated)
-- 
2.25.1


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

* [PATCH] uerofs-utils: fix random data for block-aligned uncompressed file
  2021-09-06  8:13 [PATCH] erofs-utils: remove unnecessary "\n" Huang Jianan via Linux-erofs
@ 2021-09-06  8:13 ` Huang Jianan via Linux-erofs
  2021-09-07  0:10   ` Gao Xiang
  2021-09-07  3:53   ` [PATCH V2] erofs-utils: " Huang Jianan via Linux-erofs
  2021-09-07  0:08 ` [PATCH] erofs-utils: remove unnecessary "\n" Gao Xiang
  1 sibling, 2 replies; 9+ messages in thread
From: Huang Jianan via Linux-erofs @ 2021-09-06  8:13 UTC (permalink / raw)
  To: linux-erofs; +Cc: yh, kevin.liw, guoweichao, guanyuwei

If the file size is block-aligned for uncompressed files, i_u is
meaningless for erofs_inode on disk, but it's not cleared when
datalayout is seted in erofs_prepare_inode_buffer. Clear the entire
erofs_inode to zero to fix this.

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
---
 lib/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/inode.c b/lib/inode.c
index 0ad703d..1397cc5 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -834,7 +834,7 @@ static struct erofs_inode *erofs_new_inode(void)
 	static unsigned int counter;
 	struct erofs_inode *inode;
 
-	inode = malloc(sizeof(struct erofs_inode));
+	inode = calloc(1, sizeof(struct erofs_inode));
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
 
-- 
2.25.1


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

* Re: [PATCH] erofs-utils: remove unnecessary "\n"
  2021-09-06  8:13 [PATCH] erofs-utils: remove unnecessary "\n" Huang Jianan via Linux-erofs
  2021-09-06  8:13 ` [PATCH] uerofs-utils: fix random data for block-aligned uncompressed file Huang Jianan via Linux-erofs
@ 2021-09-07  0:08 ` Gao Xiang
  1 sibling, 0 replies; 9+ messages in thread
From: Gao Xiang @ 2021-09-07  0:08 UTC (permalink / raw)
  To: Huang Jianan; +Cc: yh, kevin.liw, guoweichao, linux-erofs, guanyuwei

On Mon, Sep 06, 2021 at 04:13:58PM +0800, Huang Jianan via Linux-erofs wrote:
> Signed-off-by: Huang Jianan <huangjianan@oppo.com>
> ---
>  lib/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/inode.c b/lib/inode.c
> index 5bad75e..0ad703d 100644
> --- a/lib/inode.c
> +++ b/lib/inode.c
> @@ -744,7 +744,7 @@ int erofs_droid_inode_fsconfig(struct erofs_inode *inode,
>  			  cfg.target_out_path,
>  			  &uid, &gid, &mode, &inode->capabilities);
>  
> -	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, capabilities = 0x%" PRIx64 "\n",
> +	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, capabilities = 0x%" PRIx64,
>  		  fspath, mode, uid, gid, inode->capabilities);

Reviewed-by: Gao Xiang <xiang@kernel.org>

Thanks,
Gao Xiang

>  
>  	if (decorated)
> -- 
> 2.25.1
> 

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

* Re: [PATCH] uerofs-utils: fix random data for block-aligned uncompressed file
  2021-09-06  8:13 ` [PATCH] uerofs-utils: fix random data for block-aligned uncompressed file Huang Jianan via Linux-erofs
@ 2021-09-07  0:10   ` Gao Xiang
  2021-09-07  0:46     ` Gao Xiang
  2021-09-07  3:53   ` [PATCH V2] erofs-utils: " Huang Jianan via Linux-erofs
  1 sibling, 1 reply; 9+ messages in thread
From: Gao Xiang @ 2021-09-07  0:10 UTC (permalink / raw)
  To: Huang Jianan; +Cc: yh, kevin.liw, guoweichao, linux-erofs, guanyuwei

On Mon, Sep 06, 2021 at 04:13:59PM +0800, Huang Jianan via Linux-erofs wrote:
> If the file size is block-aligned for uncompressed files, i_u is
> meaningless for erofs_inode on disk, but it's not cleared when
> datalayout is seted in erofs_prepare_inode_buffer. Clear the entire
> erofs_inode to zero to fix this.
> 
> Signed-off-by: Huang Jianan <huangjianan@oppo.com>
> ---
>  lib/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/inode.c b/lib/inode.c
> index 0ad703d..1397cc5 100644
> --- a/lib/inode.c
> +++ b/lib/inode.c
> @@ -834,7 +834,7 @@ static struct erofs_inode *erofs_new_inode(void)
>  	static unsigned int counter;
>  	struct erofs_inode *inode;
>  
> -	inode = malloc(sizeof(struct erofs_inode));
> +	inode = calloc(1, sizeof(struct erofs_inode));

If we decide to do this, how about removing all
	inode->idata_size = 0;
	inode->xattr_isize = 0;
	inode->extent_isize = 0;

	inode->bh = inode->bh_inline = inode->bh_data = NULL;
	inode->idata = NULL;
?

Thanks,
Gao Xiang

>  	if (!inode)
>  		return ERR_PTR(-ENOMEM);
>  
> -- 
> 2.25.1
> 

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

* Re: [PATCH] uerofs-utils: fix random data for block-aligned uncompressed file
  2021-09-07  0:10   ` Gao Xiang
@ 2021-09-07  0:46     ` Gao Xiang
  2021-09-07  2:54       ` Huang Jianan via Linux-erofs
  0 siblings, 1 reply; 9+ messages in thread
From: Gao Xiang @ 2021-09-07  0:46 UTC (permalink / raw)
  To: Huang Jianan, linux-erofs, yh, kevin.liw, guoweichao, guanyuwei

On Tue, Sep 07, 2021 at 08:10:45AM +0800, Gao Xiang wrote:
> On Mon, Sep 06, 2021 at 04:13:59PM +0800, Huang Jianan via Linux-erofs wrote:
> > If the file size is block-aligned for uncompressed files, i_u is
> > meaningless for erofs_inode on disk, but it's not cleared when
> > datalayout is seted in erofs_prepare_inode_buffer. Clear the entire
> > erofs_inode to zero to fix this.
> > 
> > Signed-off-by: Huang Jianan <huangjianan@oppo.com>
> > ---
> >  lib/inode.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/lib/inode.c b/lib/inode.c
> > index 0ad703d..1397cc5 100644
> > --- a/lib/inode.c
> > +++ b/lib/inode.c
> > @@ -834,7 +834,7 @@ static struct erofs_inode *erofs_new_inode(void)
> >  	static unsigned int counter;
> >  	struct erofs_inode *inode;
> >  
> > -	inode = malloc(sizeof(struct erofs_inode));
> > +	inode = calloc(1, sizeof(struct erofs_inode));
> 
> If we decide to do this, how about removing all
> 	inode->idata_size = 0;
> 	inode->xattr_isize = 0;
> 	inode->extent_isize = 0;
> 
> 	inode->bh = inode->bh_inline = inode->bh_data = NULL;
> 	inode->idata = NULL;

Please also add a note that this only impacts OTA packages in the
commit message about the background since it has some impact to
the reproducible builds.

Thanks,
Gao Xiang

> ?
> 
> Thanks,
> Gao Xiang
> 
> >  	if (!inode)
> >  		return ERR_PTR(-ENOMEM);
> >  
> > -- 
> > 2.25.1
> > 

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

* Re: [PATCH] uerofs-utils: fix random data for block-aligned uncompressed file
  2021-09-07  0:46     ` Gao Xiang
@ 2021-09-07  2:54       ` Huang Jianan via Linux-erofs
  0 siblings, 0 replies; 9+ messages in thread
From: Huang Jianan via Linux-erofs @ 2021-09-07  2:54 UTC (permalink / raw)
  To: Gao Xiang; +Cc: yh, kevin.liw, guoweichao, linux-erofs, guanyuwei

在 2021/9/7 8:46, Gao Xiang 写道:
> On Tue, Sep 07, 2021 at 08:10:45AM +0800, Gao Xiang wrote:
>> On Mon, Sep 06, 2021 at 04:13:59PM +0800, Huang Jianan via Linux-erofs wrote:
>>> If the file size is block-aligned for uncompressed files, i_u is
>>> meaningless for erofs_inode on disk, but it's not cleared when
>>> datalayout is seted in erofs_prepare_inode_buffer. Clear the entire
>>> erofs_inode to zero to fix this.
>>>
>>> Signed-off-by: Huang Jianan <huangjianan@oppo.com>
>>> ---
>>>   lib/inode.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/lib/inode.c b/lib/inode.c
>>> index 0ad703d..1397cc5 100644
>>> --- a/lib/inode.c
>>> +++ b/lib/inode.c
>>> @@ -834,7 +834,7 @@ static struct erofs_inode *erofs_new_inode(void)
>>>   	static unsigned int counter;
>>>   	struct erofs_inode *inode;
>>>   
>>> -	inode = malloc(sizeof(struct erofs_inode));
>>> +	inode = calloc(1, sizeof(struct erofs_inode));
>> If we decide to do this, how about removing all
>> 	inode->idata_size = 0;
>> 	inode->xattr_isize = 0;
>> 	inode->extent_isize = 0;
>>
>> 	inode->bh = inode->bh_inline = inode->bh_data = NULL;
>> 	inode->idata = NULL;
> Please also add a note that this only impacts OTA packages in the
> commit message about the background since it has some impact to
> the reproducible builds.
I think this won't impact ota packages, mainly it will affect the 
reproducible
builds.

Thanks,
Jianan
> Thanks,
> Gao Xiang
>
>> ?
>>
>> Thanks,
>> Gao Xiang
>>
>>>   	if (!inode)
>>>   		return ERR_PTR(-ENOMEM);
>>>   
>>> -- 
>>> 2.25.1
>>>


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

* [PATCH V2] erofs-utils: fix random data for block-aligned uncompressed file
  2021-09-06  8:13 ` [PATCH] uerofs-utils: fix random data for block-aligned uncompressed file Huang Jianan via Linux-erofs
  2021-09-07  0:10   ` Gao Xiang
@ 2021-09-07  3:53   ` Huang Jianan via Linux-erofs
  2021-09-07 13:20     ` Gao Xiang
  1 sibling, 1 reply; 9+ messages in thread
From: Huang Jianan via Linux-erofs @ 2021-09-07  3:53 UTC (permalink / raw)
  To: linux-erofs; +Cc: yh, kevin.liw, guoweichao, guanyuwei

If the file size is block-aligned for uncompressed files, i_u is
meaningless for erofs_inode on disk, but it's not cleared when
datalayout is seted in erofs_prepare_inode_buffer.

This problem will cause inconsistent reproducible builds. Clear the
entire erofs_inode to zero to fix this.

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
---
 lib/inode.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/lib/inode.c b/lib/inode.c
index 5bad75e..0cce07d 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -834,25 +834,15 @@ static struct erofs_inode *erofs_new_inode(void)
 	static unsigned int counter;
 	struct erofs_inode *inode;
 
-	inode = malloc(sizeof(struct erofs_inode));
+	inode = calloc(1, sizeof(struct erofs_inode));
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
 
-	inode->i_parent = NULL;	/* also used to indicate a new inode */
-
 	inode->i_ino[0] = counter++;	/* inode serial number */
 	inode->i_count = 1;
 
 	init_list_head(&inode->i_subdirs);
 	init_list_head(&inode->i_xattrs);
-
-	inode->idata_size = 0;
-	inode->xattr_isize = 0;
-	inode->extent_isize = 0;
-
-	inode->bh = inode->bh_inline = inode->bh_data = NULL;
-	inode->idata = NULL;
-	inode->z_physical_clusterblks = 0;
 	return inode;
 }
 
-- 
2.25.1


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

* Re: [PATCH V2] erofs-utils: fix random data for block-aligned uncompressed file
  2021-09-07  3:53   ` [PATCH V2] erofs-utils: " Huang Jianan via Linux-erofs
@ 2021-09-07 13:20     ` Gao Xiang
  2021-09-07 13:54       ` Huang Jianan via Linux-erofs
  0 siblings, 1 reply; 9+ messages in thread
From: Gao Xiang @ 2021-09-07 13:20 UTC (permalink / raw)
  To: Huang Jianan; +Cc: yh, kevin.liw, guoweichao, linux-erofs, guanyuwei

On Tue, Sep 07, 2021 at 11:53:45AM +0800, Huang Jianan via Linux-erofs wrote:
> If the file size is block-aligned for uncompressed files, i_u is
> meaningless for erofs_inode on disk, but it's not cleared when
> datalayout is seted in erofs_prepare_inode_buffer.
> 
> This problem will cause inconsistent reproducible builds. Clear the
> entire erofs_inode to zero to fix this.
> 
> Signed-off-by: Huang Jianan <huangjianan@oppo.com>

Reviewed-by: Gao Xiang <xiang@kernel.org>

BTW, how about adding --from="Huang Jianan <huangjianan@oppo.com>" when
sending patches with OPPO emails.

Otherwise, it seems the author becomes
"Huang Jianan via Linux-erofs <linux-erofs@lists.ozlabs.org>" when
reaching to the mailing list and I have to update it by hand....

Thanks,
Gao Xiang

> ---
>  lib/inode.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/lib/inode.c b/lib/inode.c
> index 5bad75e..0cce07d 100644
> --- a/lib/inode.c
> +++ b/lib/inode.c
> @@ -834,25 +834,15 @@ static struct erofs_inode *erofs_new_inode(void)
>  	static unsigned int counter;
>  	struct erofs_inode *inode;
>  
> -	inode = malloc(sizeof(struct erofs_inode));
> +	inode = calloc(1, sizeof(struct erofs_inode));
>  	if (!inode)
>  		return ERR_PTR(-ENOMEM);
>  
> -	inode->i_parent = NULL;	/* also used to indicate a new inode */
> -
>  	inode->i_ino[0] = counter++;	/* inode serial number */
>  	inode->i_count = 1;
>  
>  	init_list_head(&inode->i_subdirs);
>  	init_list_head(&inode->i_xattrs);
> -
> -	inode->idata_size = 0;
> -	inode->xattr_isize = 0;
> -	inode->extent_isize = 0;
> -
> -	inode->bh = inode->bh_inline = inode->bh_data = NULL;
> -	inode->idata = NULL;
> -	inode->z_physical_clusterblks = 0;
>  	return inode;
>  }
>  
> -- 
> 2.25.1
> 

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

* Re: [PATCH V2] erofs-utils: fix random data for block-aligned uncompressed file
  2021-09-07 13:20     ` Gao Xiang
@ 2021-09-07 13:54       ` Huang Jianan via Linux-erofs
  0 siblings, 0 replies; 9+ messages in thread
From: Huang Jianan via Linux-erofs @ 2021-09-07 13:54 UTC (permalink / raw)
  To: Gao Xiang; +Cc: yh, kevin.liw, guoweichao, linux-erofs, guanyuwei

在 2021/9/7 21:20, Gao Xiang 写道:
> On Tue, Sep 07, 2021 at 11:53:45AM +0800, Huang Jianan via Linux-erofs wrote:
>> If the file size is block-aligned for uncompressed files, i_u is
>> meaningless for erofs_inode on disk, but it's not cleared when
>> datalayout is seted in erofs_prepare_inode_buffer.
>>
>> This problem will cause inconsistent reproducible builds. Clear the
>> entire erofs_inode to zero to fix this.
>>
>> Signed-off-by: Huang Jianan <huangjianan@oppo.com>
> Reviewed-by: Gao Xiang <xiang@kernel.org>
>
> BTW, how about adding --from="Huang Jianan <huangjianan@oppo.com>" when
> sending patches with OPPO emails.
>
> Otherwise, it seems the author becomes
> "Huang Jianan via Linux-erofs <linux-erofs@lists.ozlabs.org>" when
> reaching to the mailing list and I have to update it by hand....
Thanks for pointing this out, I will pay attention next time.

Thanks,
Jianan
> Thanks,
> Gao Xiang
>
>> ---
>>   lib/inode.c | 12 +-----------
>>   1 file changed, 1 insertion(+), 11 deletions(-)
>>
>> diff --git a/lib/inode.c b/lib/inode.c
>> index 5bad75e..0cce07d 100644
>> --- a/lib/inode.c
>> +++ b/lib/inode.c
>> @@ -834,25 +834,15 @@ static struct erofs_inode *erofs_new_inode(void)
>>   	static unsigned int counter;
>>   	struct erofs_inode *inode;
>>   
>> -	inode = malloc(sizeof(struct erofs_inode));
>> +	inode = calloc(1, sizeof(struct erofs_inode));
>>   	if (!inode)
>>   		return ERR_PTR(-ENOMEM);
>>   
>> -	inode->i_parent = NULL;	/* also used to indicate a new inode */
>> -
>>   	inode->i_ino[0] = counter++;	/* inode serial number */
>>   	inode->i_count = 1;
>>   
>>   	init_list_head(&inode->i_subdirs);
>>   	init_list_head(&inode->i_xattrs);
>> -
>> -	inode->idata_size = 0;
>> -	inode->xattr_isize = 0;
>> -	inode->extent_isize = 0;
>> -
>> -	inode->bh = inode->bh_inline = inode->bh_data = NULL;
>> -	inode->idata = NULL;
>> -	inode->z_physical_clusterblks = 0;
>>   	return inode;
>>   }
>>   
>> -- 
>> 2.25.1
>>


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

end of thread, other threads:[~2021-09-07 13:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06  8:13 [PATCH] erofs-utils: remove unnecessary "\n" Huang Jianan via Linux-erofs
2021-09-06  8:13 ` [PATCH] uerofs-utils: fix random data for block-aligned uncompressed file Huang Jianan via Linux-erofs
2021-09-07  0:10   ` Gao Xiang
2021-09-07  0:46     ` Gao Xiang
2021-09-07  2:54       ` Huang Jianan via Linux-erofs
2021-09-07  3:53   ` [PATCH V2] erofs-utils: " Huang Jianan via Linux-erofs
2021-09-07 13:20     ` Gao Xiang
2021-09-07 13:54       ` Huang Jianan via Linux-erofs
2021-09-07  0:08 ` [PATCH] erofs-utils: remove unnecessary "\n" Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).