Re: [PATCH RESEND] erofs: convert to use the new mount fs_context api

Gao Xiang
2019-12-29T02:46:53Z

On Sat, Dec 28, 2019 at 09:21:56PM +0000, Al Viro wrote:
> On Fri, Dec 27, 2019 at 11:50:16AM +0800, Gao Xiang wrote:
> > Hi Al,
> >
> > Greeting, we plan to convert erofs to new mount api for 5.6
> >
> > and I just notice your branch
> > https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/log/?h=untested.fs_parse
> >
> > do a lot further work on fs context (e.g. "get rid of ->enums",
> > "remove fs_parameter_description name field" and switch to
> > use XXXfc() instead of XXXf() with prefixed string).
> >
> > Does it plan for 5.6 as well? If yes, we will update this patch
> > based on the latest branch and maybe have chance to go though
> > your tree if it can?
>
> FWIW, I would add the following to what you've already mentioned:

Thanks for your reply and confirmation.

>
> > > +static const struct fs_parameter_spec erofs_param_specs[] = {
> > > + fsparam_flag("user_xattr", Opt_user_xattr),
> > > + fsparam_flag("nouser_xattr", Opt_nouser_xattr),
> > > + fsparam_flag("acl", Opt_acl),
> > > + fsparam_flag("noacl", Opt_noacl),
> better off as
> fsparam_flag_no("user_xattr", Opt_user_xattr),
> fsparam_flag_no("acl", Opt_acl),

Got it. We didn't notice this new way. Will fix in the updated version.

>
> > > + case Opt_user_xattr:
> if (result.boolean)
> set_opt(sbi, XATTR_USER);
> else
> clear_opt(sbi, XATTR_USER);
> > > + break;
> ....
> > > + default:
> return -ENOPARAM;

Got it.

>
> BTW, what's the point of using invalf() in contexts where
> the return value is ignored? Why not simply go for errorf()
> (or errorfc(), for that matter)?

OK, We will check all invalf()s soon.

And may I ask one more question about this... I'm a bit confused,
since we have erofs_err() which print sb->s_id as well, so which
one (errorfc or erofs_err) is more perferred to choose in especially
fill_super()?

>
> I do plan that branch (or an equivalent, as far as filesystems
> are concerned - there might be a bit of additional rework in
> the beginning + currently missing modifications of docs) for
> 5.6. So updated patch would be welcome - I can do that myself,
> but if you can rebase it on top of that branch it would save
> time.

Yes, we will update this patch based on the latest branch later
for this convert.

Thanks,
Gao Xiang