All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yue Hu <zbestahu@gmail.com>
To: Gao Xiang <hsiangkao@redhat.com>
Cc: huyue2@yulong.com, xiang@kernel.org,
	linux-erofs@lists.ozlabs.org, zhangwen@yulong.com
Subject: Re: [PATCH] AOSP: erofs-utils: fix sub directory prefix path in canned fs_config
Date: Thu, 24 Dec 2020 11:45:42 +0800	[thread overview]
Message-ID: <20201224114542.0000461f.zbestahu@gmail.com> (raw)
In-Reply-To: <20201222104700.GB1831635@xiangao.remote.csb>

On Tue, 22 Dec 2020 18:47:00 +0800
Gao Xiang <hsiangkao@redhat.com> wrote:

> On Tue, Dec 22, 2020 at 06:34:11PM +0800, Yue Hu wrote:
> 
> ...
> 
> > > 
> > > Hmmm... such design is quite strange for me....
> > > Could you try the following diff?
> > > 
> > > diff --git a/lib/inode.c b/lib/inode.c
> > > index 9469074..9af6179 100644
> > > --- a/lib/inode.c
> > > +++ b/lib/inode.c
> > > @@ -698,11 +698,14 @@ int erofs_droid_inode_fsconfig(struct erofs_inode *inode,
> > >  	/* filesystem_config does not preserve file type bits */
> > >  	mode_t stat_file_type_mask = st->st_mode & S_IFMT;
> > >  	unsigned int uid = 0, gid = 0, mode = 0;
> > > +	bool alloced;
> > >  	char *fspath;
> > >  
> > >  	inode->capabilities = 0;
> > > -	if (!cfg.mount_point)
> > > -		fspath = erofs_fspath(path);
> > > +
> > > +	alloced = (cfg.mount_point && erofs_fspath(path)[0] != '\0');
> > > +	if (!alloced)
> > > +		fspath = (char *)erofs_fspath(path);
> > >  	else if (asprintf(&fspath, "%s/%s", cfg.mount_point,
> > >  			  erofs_fspath(path)) <= 0)
> > >  		return -ENOMEM;
> > > @@ -718,7 +721,7 @@ int erofs_droid_inode_fsconfig(struct erofs_inode *inode,
> > >  			  cfg.target_out_path,
> > >  			  &uid, &gid, &mode, &inode->capabilities);
> > >  
> > > -	if (cfg.mount_point)
> > > +	if (alloced)
> > >  		free(fspath);
> > >  	st->st_uid = uid;
> > >  	st->st_gid = gid;
> > > 
> > > if it works, will redo a formal patch then....  
> > 
> > Works for me for canned fs_config.  
> 
> Ok, if it also works fine for non-canned fs_config on your side,
> I will redo a formal patch later... sigh :(

Hi Xiang,

I just remove the "--fs-config-file" in my test enviroment, after that,
build and boot are all working fine. 

If canned fs_config never used by others before, i think it's a bug. 

Thx.

> 
> Thanks,
> Gao Xiang
> 
> > 
> > Thx.  
> 


  reply	other threads:[~2020-12-24  3:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22  2:04 [PATCH] AOSP: erofs-utils: fix sub directory prefix path in canned fs_config Yue Hu
2020-12-22  3:44 ` Gao Xiang
2020-12-22  4:47   ` Yue Hu
2020-12-22  6:31     ` Gao Xiang
2020-12-22  7:04       ` Gao Xiang
2020-12-22  7:12         ` Yue Hu
2020-12-22  8:10         ` Yue Hu
2020-12-22  9:13           ` Gao Xiang
2020-12-22  9:27             ` Gao Xiang
2020-12-22  9:30             ` Yue Hu
2020-12-22  9:39               ` Gao Xiang
2020-12-22  9:46                 ` Yue Hu
2020-12-22  9:59                   ` Gao Xiang
2020-12-22 10:17                     ` Yue Hu
2020-12-22 10:33                       ` Gao Xiang
2020-12-22 11:07                         ` Yue Hu
2020-12-22 10:34                 ` Yue Hu
2020-12-22 10:47                   ` Gao Xiang
2020-12-24  3:45                     ` Yue Hu [this message]
2020-12-24  4:19                       ` 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=20201224114542.0000461f.zbestahu@gmail.com \
    --to=zbestahu@gmail.com \
    --cc=hsiangkao@redhat.com \
    --cc=huyue2@yulong.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=xiang@kernel.org \
    --cc=zhangwen@yulong.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 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.