From: Karel Zak <kzak@redhat.com>
To: Yecheng Fu <cofyc.jackson@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2] vfs: use "none" if mount source is empty string
Date: Thu, 12 Jul 2018 10:43:54 +0200 [thread overview]
Message-ID: <20180712084354.2npy5ram3zmhtagp@ws.net.home> (raw)
In-Reply-To: <20180712022848.GA89138@jupiter.local>
On Thu, Jul 12, 2018 at 10:29:50AM +0800, Yecheng Fu wrote:
> On Tue, May 15, 2018 at 01:18:00PM +0800, Yecheng Fu wrote:
> > On Thu, Apr 19, 2018 at 04:32:56AM -0700, Matthew Wilcox wrote:
> > > On Thu, Apr 19, 2018 at 11:47:21AM +0800, Yecheng Fu wrote:
> > > > `libmount` from util-linux and many softwares in userspace (e.g.
> > > > kubelet) did not expect empty string as mount source:
> > > >
> > > > ```
> > > > $ mount -t tmpfs "" /mnt/tmpfs
> > > > $ findmnt /mnt/tmpfs
> > > > findmnt: /proc/self/mountinfo: parse error at line 51
> > > > $ cat /proc/self/mountinfo | grep -P '\/mnt\/tmpfs'
> > > > 74 25 0:59 / /mnt/tmpfs rw,relatime shared:38 - tmpfs rw
> > > > $ cat /proc/self/mounts | grep -P '\/mnt\/tmpfs'
> > > > /mnt/tmpfs tmpfs rw,relatime 0 0
> > > > ```
> > > >
> > > > `source` field in mounts/mountinfo is empty, which breaks a lot of
> > > > mounts/mountinfo parsers.
> > > >
> > > > This fixes issues in parsing when user uses empty string as mount
> > > > source.
> > > >
> > > > Cc: Karel Zak <kzak@redhat.com>
> > > > Signed-off-by: Yecheng Fu <cofyc.jackson@gmail.com>
> > >
> > > Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
> >
> > hi, I'm a newbie here. Will this be merged or is there still something I
> > need to do?
> >
> > I had submitted a patch to [util-linux](https://github.com/karelzak/util-linux/pull/619). Karel prefer kernel side bugfix than rewrite all the sscanf() stuff and I agree. Kernel side bugfix also fixes all parsers too.
> >
> > --
> > Yecheng Fu
>
> hi, didn't receive any updates for months, sorry to ping again in case
> someone missed it.
>
> Karel patched util-linux to work around this issue now [^1], but I hope this
> can be fixed on kernel side too to improve compatibility.
I agree. I'm absolutely sure that in userspace are many many another
places where nobody expects empty mount source in /proc/self/mountinfo.
It would be really nice to use there "none" as placeholder.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
prev parent reply other threads:[~2018-07-12 8:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-19 3:47 [PATCH v2] vfs: use "none" if mount source is empty string Yecheng Fu
2018-04-19 11:32 ` Matthew Wilcox
2018-05-15 5:18 ` Yecheng Fu
2018-07-12 2:29 ` Yecheng Fu
2018-07-12 8:43 ` Karel Zak [this message]
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=20180712084354.2npy5ram3zmhtagp@ws.net.home \
--to=kzak@redhat.com \
--cc=cofyc.jackson@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).