linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Huang Jianan <huangjianan@oppo.com>,
	linux-erofs@lists.ozlabs.org, yh@oppo.com, kevin.liw@oppo.com,
	guoweichao@oppo.com, guanyuwei@oppo.com
Subject: Re: [PATCH] uerofs-utils: fix random data for block-aligned uncompressed file
Date: Tue, 7 Sep 2021 08:46:24 +0800	[thread overview]
Message-ID: <YTa2YLuTBwvHCSAf@B-P7TQMD6M-0146.local> (raw)
In-Reply-To: <20210907001038.GC23541@hsiangkao-HP-ZHAN-66-Pro-G1>

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
> > 

  reply	other threads:[~2021-09-07  0:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YTa2YLuTBwvHCSAf@B-P7TQMD6M-0146.local \
    --to=hsiangkao@linux.alibaba.com \
    --cc=guanyuwei@oppo.com \
    --cc=guoweichao@oppo.com \
    --cc=huangjianan@oppo.com \
    --cc=kevin.liw@oppo.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=yh@oppo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).