All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	Sebastian Wick <sebastian.wick@redhat.com>,
	Ryan Hendrickson <ryan.hendrickson@alum.mit.edu>,
	linux-unionfs@vger.kernel.org, Karel Zak <kzak@redhat.com>
Subject: Re: [regression?] escaping commas in overlayfs mount options
Date: Thu, 12 Oct 2023 11:49:12 +0200	[thread overview]
Message-ID: <20231012-bekam-beneiden-eafffa72ab2b@brauner> (raw)
In-Reply-To: <CAOQ4uxhU4kh5j55RpvD7=vkagySTbbvc=CqLv6sxk5114k4Kvg@mail.gmail.com>

On Thu, Oct 12, 2023 at 12:27:26PM +0300, Amir Goldstein wrote:
> On Thu, Oct 12, 2023 at 11:26 AM Christian Brauner <brauner@kernel.org> wrote:
> >
> > > > Christian,
> > > >
> > > > Do you know any userspace that already uses your new append prefixes?
> > > > Do we have any good reason to support "lowerdir_first"
> > > > so a lower dir stack could be reset before creating the sb?
> > >
> > > If that is a requirement, I suggest extending fsconfig(2) to allow
> > > resetting an option.
> >
> > Overlayfs does already support this. If you pass:
> > fsconfig(FSCONFIG_SET_STRING, "lowerdir", "", ...)
> > then the lower layer stack is reset. I've implemented it that way in
> > ovl_parse_param_lowerdir().
> >
> 
> Yes, I noticed that. Cool.
> 
> > >
> > > > > > > >
> > > > > > > > Anyway, let's focus on what you would like best.
> > > > > > > > If you prefer to just fix the regression, it is doable.
> > > > > > > > If you prefer the upperdirfd, workdirfd, lowerdirfd API, I think we can
> > > > > > > > find a volunteer to write it up.
> > >
> > > Can't the existing option names be overloaded if a separate cmd
> > > (FSCONFIG_SET_PATH or FSCONFIG_SET_PATH_EMPTY) is used in fsconfig()?
> >
> > Yes, they can and filesystems do do that today depending on whether they
> > want to e.g., take an fd or a path or something.
> 
> Nice. It seems like Miklos has volunteered to implement the
> dirfd and/or unescaped API variants for the new mount API :)
> 
> What is your opinion about the original regression report
> regarding escaping of commas in ->parse_monolithic()?
> 
> It's easy to implement ovl_parse_monolithic() that will
> conform to the old ovl_next_opt() behavior, but it does not
> solve the problem long term.
> 
> If there are currently setups in the wild that pass arguments
> like [lowerdir=/tmp/a\,b/], even if I do fix up ovl_parse_monolithic()
> those setups will regress when they upgrade to libmount v2.39,
> because AFAICT, libmount does not respect "\," to escape option split,
> it respects [lowerdir="/tmp/a,b/"] to escape option split.

For full backward compatibility we would probably need to fix both the
kernel and libmount. Because libmount/mount(8) is encouraged to split a
lowerdir=/a:/b:/c:/d option into separate fsconfig calls, especially
when dealing with really long paths. So libmount would need to be aware
of overlayfs parsing behavior that includes escaping \, even if we fix
the kernel itself.

I don't think that would be a big deal because libmount already has to
deal with all kinds of filesystems specific quirks.

However, libmount also added LIBMOUNT_FORCE_MOUNT2={always,never,auto}
which can be used to disable using the new mount api and makes it use
the old mount api which is available in libmount 2.39.

So I think complementing overlayfs with a ->parse_monolithic() option
might be something that we could consider doing but this is a judgement
call there's not clear right and wrong with so many moving parts...

> 
> If we do decide that we need to or want to fix ->parse_monolithic()
> then do you think it would make sense to respect "\," escaping in
> generic_parse_monolithic()?
> I cannot imagine any workload that would get regressed by this
> (famous last words).

I'm pretty sure that this would break something so I would be hesitant
doing this.

  reply	other threads:[~2023-10-12  9:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29  1:07 [regression?] escaping commas in overlayfs mount options Ryan Hendrickson
2023-09-29  4:44 ` Amir Goldstein
2023-10-02 22:22   ` Ryan Hendrickson
2023-10-03  9:50     ` Amir Goldstein
2023-10-03 19:07       ` Ryan Hendrickson
2023-10-04  9:03         ` Amir Goldstein
2023-10-06 13:02   ` Sebastian Wick
2023-10-06 16:17     ` Amir Goldstein
2023-10-06 16:42       ` Ryan Hendrickson
2023-10-06 17:21         ` Amir Goldstein
2023-10-10  9:06           ` Miklos Szeredi
2023-10-10 10:00             ` Amir Goldstein
2023-10-10 16:13               ` Sebastian Wick
2023-10-10 16:54                 ` Amir Goldstein
2023-10-10 17:33                   ` Sebastian Wick
2023-10-10 18:15                     ` Amir Goldstein
2023-10-10 18:33                       ` Miklos Szeredi
2023-10-11  8:44                         ` Amir Goldstein
2023-10-11 10:18                           ` Miklos Szeredi
2023-10-11 12:06                             ` Amir Goldstein
2023-10-11 13:07                               ` Miklos Szeredi
2023-10-11 14:33                                 ` Miklos Szeredi
2023-10-11 16:37                                   ` Amir Goldstein
2023-10-11 16:43                                 ` Amir Goldstein
2023-10-12  8:26                                 ` Christian Brauner
2023-10-12  9:27                                   ` Amir Goldstein
2023-10-12  9:49                                     ` Christian Brauner [this message]
2023-10-12 13:54                                       ` Amir Goldstein
2023-10-12 18:07                                         ` Sebastian Wick
2023-10-12  8:21                               ` Christian Brauner
2023-09-29  5:07 ` Linux regression tracking (Thorsten Leemhuis)

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=20231012-bekam-beneiden-eafffa72ab2b@brauner \
    --to=brauner@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=kzak@redhat.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=ryan.hendrickson@alum.mit.edu \
    --cc=sebastian.wick@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.