Re: [PATCH v2 3/3] ovl: fix the parsing of empty string mount parameters

From: Luis Henriques
Date: Fri Mar 22 2024 - 11:17:21 EST


Christian Brauner <brauner@xxxxxxxxxx> writes:

> On Tue, Mar 12, 2024 at 10:31:08AM +0000, Luis Henriques wrote:
>> Christian Brauner <brauner@xxxxxxxxxx> writes:
>>
>> > On Mon, Mar 11, 2024 at 03:39:39PM +0100, Miklos Szeredi wrote:
>> >> On Mon, 11 Mar 2024 at 14:25, Christian Brauner <brauner@xxxxxxxxxx> wrote:
>> >>
>> >> > Yeah, so with that I do agree. But have you read my reply to the other
>> >> > thread? I'd like to hear your thoughs on that. The problem is that
>> >> > mount(8) currently does:
>> >> >
>> >> > fsconfig(3, FSCONFIG_SET_FLAG, "usrjquota", NULL, 0) = -1 EINVAL (Invalid argument)
>> >> >
>> >> > for both -o usrjquota and -o usrjquota=
>> >>
>> >> For "-o usrjquota" this seems right.
>> >>
>> >> For "-o usrjquota=" it doesn't. Flags should never have that "=", so
>> >> this seems buggy in more than one ways.
>> >>
>> >> > So we need a clear contract with userspace or the in-kernel solution
>> >> > proposed here. I see the following options:
>> >> >
>> >> > (1) Userspace must know that mount options such as "usrjquota" that can
>> >> > have no value must be specified as "usrjquota=" when passed to
>> >> > mount(8). This in turn means we need to tell Karel to update
>> >> > mount(8) to recognize this and infer from "usrjquota=" that it must
>> >> > be passed as FSCONFIG_SET_STRING.
>> >>
>> >> Yes, this is what I'm thinking. Of course this only works if there
>> >> are no backward compatibility issues, if "-o usrjquota" worked in the
>> >> past and some systems out there relied on this, then this is not
>> >> sufficient.
>> >
>> > Ok, I spoke to Karel and filed:
>> >
>> > https://github.com/util-linux/util-linux/issues/2837
>
> This is now merged as of today and backported to at least util-linux
> 2.40 which is the current release.
> https://github.com/util-linux/util-linux/pull/2849
>
> If your distros ship 2.39 and won't upgrade to 2.40 for a while it might
> be worth cherry-picking that fix.

That's awesome, thanks a lot for pushing this. I just gave it a try and
it looks good -- ext4/053 isn't failing any more with the next version.

Cheers,
--
Luis