From: Ian Kent <raven@themaw.net>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Siddhesh Poyarekar <siddhesh@gotplt.org>,
David Howells <dhowells@redhat.com>,
Miklos Szeredi <miklos@szeredi.hu>,
Carlos Maiolino <cmaiolino@redhat.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] vfs: parse: deal with zero length string value
Date: Fri, 1 Jul 2022 14:29:23 +0800 [thread overview]
Message-ID: <ccc58c3d-ed6d-c3a2-15f7-928b289779cd@themaw.net> (raw)
In-Reply-To: <e2c566f9-47e4-cfdc-ad4a-426ecdfb16e4@themaw.net>
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
next prev parent reply other threads:[~2022-07-01 6:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 0:30 [PATCH 0/2] vfs: fix a couple of mount table handling problems Ian Kent
2022-06-28 0:30 ` [PATCH 1/2] vfs: parse: deal with zero length string value Ian Kent
2022-06-28 17:55 ` Al Viro
2022-06-29 1:06 ` Ian Kent
2022-07-01 6:29 ` Ian Kent [this message]
2022-06-28 0:30 ` [PATCH 2/2] vfs: escape hash as well Ian Kent
2022-06-28 17:57 ` Al Viro
-- strict thread matches above, loose matches on Subject: below --
2022-06-17 5:08 [PATCH 0/2] vfs: fix a couple of mount table handling problems Ian Kent
2022-06-17 5:09 ` [PATCH 1/2] vfs: parse: deal with zero length string value Ian Kent
2022-06-28 13:03 ` Christian Brauner
2021-10-25 4:05 Ian Kent
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=ccc58c3d-ed6d-c3a2-15f7-928b289779cd@themaw.net \
--to=raven@themaw.net \
--cc=akpm@linux-foundation.org \
--cc=cmaiolino@redhat.com \
--cc=dhowells@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=siddhesh@gotplt.org \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®