[PATCH] AOSP: erofs-utils: fix sub-directory prefix for canned fs_config

Gao Xiang hsiangkao at redhat.com
Mon Dec 28 21:48:30 AEDT 2020


On Mon, Dec 28, 2020 at 06:03:26PM +0800, Huang Jianan wrote:
> 
> 在 2020/12/26 14:27, Gao Xiang 写道:

...

> > +	if (!cfg.mount_point ||
> > +	/* have to drop the mountpoint for rootdir of canned fsconfig */
> > +	    (cfg.fs_config_file && IS_ROOT(inode))) {
> 
> Hi Xiang,
> 
> I have tested this patch with --fs-config-file, and the problem still
> exists.
> 
> IS_ROOT can't be used here to determine the root directory , because
> inode->i_parent is null at this time. It will be set after this function.
> 

Hi Jianan,

Thanks for your report! Sorry for the troublesome.
I need to turn back as the next version.... Very sorry about this!

Thanks,
Gao Xiang

> Thanks,
> 
> Jianan
> 
> > +		fspath = erofs_fspath(path);
> > +	} else {
> > +		if (asprintf(&decorated, "%s/%s", cfg.mount_point,
> > +			     erofs_fspath(path)) <= 0)
> > +			return -ENOMEM;
> > +		fspath = decorated;
> > +	}
> > +
> >   	if (cfg.fs_config_file)
> > -		canned_fs_config(erofs_fspath(path),
> > +		canned_fs_config(fspath,
> >   				 S_ISDIR(st->st_mode),
> >   				 cfg.target_out_path,
> >   				 &uid, &gid, &mode, &inode->capabilities);
> > -	else if (cfg.mount_point) {
> > -		if (asprintf(&fspath, "%s/%s", cfg.mount_point,
> > -			     erofs_fspath(path)) <= 0)
> > -			return -ENOMEM;
> > -
> > +	else
> >   		fs_config(fspath, S_ISDIR(st->st_mode),
> >   			  cfg.target_out_path,
> >   			  &uid, &gid, &mode, &inode->capabilities);
> > -		free(fspath);
> > -	}
> > -	st->st_uid = uid;
> > -	st->st_gid = gid;
> > -	st->st_mode = mode | stat_file_type_mask;
> >   	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, "
> >   		  "capabilities = 0x%" PRIx64 "\n",
> > -		  erofs_fspath(path),
> > -		  mode, uid, gid, inode->capabilities);
> > +		  fspath, mode, uid, gid, inode->capabilities);
> > +
> > +	if (decorated)
> > +		free(decorated);
> > +	st->st_uid = uid;
> > +	st->st_gid = gid;
> > +	st->st_mode = mode | stat_file_type_mask;
> >   	return 0;
> >   }
> >   #else
> 



More information about the Linux-erofs mailing list