[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ccc58c3d-ed6d-c3a2-15f7-928b289779cd@themaw.net>
Date: Fri, 1 Jul 2022 14:29:23 +0800
From: Ian Kent <raven@...maw.net>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Siddhesh Poyarekar <siddhesh@...plt.org>,
David Howells <dhowells@...hat.com>,
Miklos Szeredi <miklos@...redi.hu>,
Carlos Maiolino <cmaiolino@...hat.com>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] vfs: parse: deal with zero length string value
On 29/6/22 09:06, Ian Kent wrote:
>
> On 29/6/22 01:55, Al Viro wrote:
>> On Tue, Jun 28, 2022 at 08:30:52AM +0800, Ian Kent wrote:
>>> Parsing an fs string that has zero length should result in the
>>> parameter
>>> being set to NULL so that downstream processing handles it correctly.
>>> For example, the proc mount table processing should print "(none)" in
>>> this case to preserve mount record field count, but if the value points
>>> to the NULL string this doesn't happen.
>> Hmmm... And what happens if you feed that to ->parse_param(), which
>> calls fs_parse(), which decides that param->key looks like a name of
>> e.g.
>> u32 option and calls fs_param_is_u32() to see what's what? OOPS is a
>> form
>> of rejection, I suppose, but...
>
> Oh ... yes, would you be ok with an update that moves the
>
> "param.type = fs_value_is_string;" inside the above else
>
> clause?
Looks like I'll need to use a type other than fs_value_is_string
so I can identify the case in those conversion functions when
there's no value for the parameter.
I'm tempted to use fs_value_is_flag since it's already present but
a new type of fs_value_is_empty is probably better.
What do you think about doing it like this and that type naming too?
Ian
Powered by blists - more mailing lists