Re: [regression?] escaping commas in overlayfs mount options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 3, 2023 at 1:23 AM Ryan Hendrickson
<ryan.hendrickson@xxxxxxxxxxxx> wrote:
>
> At 2023-09-29 07:44+0300, Amir Goldstein <amir73il@xxxxxxxxx> sent:
>
> > That's a good guess.
> > It helps to CC the author of the patch in this case ;-)
>
> Ha, oops! Sorry, I have been spoiled by web-based bug reporting interfaces
> and actually e-mailing maintainers is weirdly a novel experience.
>
> > The question is whether we should fix it.
> > The rule of thumb is that if users complain than we need to fix it,
> > but it's a corner case and if the only users that complained are willing
> > to work around the problem (hint hint) then we may not need to fix it.
>
> Gotcha. In my specific situation, unless there is an alternate escaping
> mechanism or mount API that works identically in both <6.5 and >=6.5, I'm
> going to have to do some version detection to work around the regression
> in released 6.5 kernels regardless of whether the old functionality is
> restored later. As long as there is *some* way of using overlayfs with
> arbitrary path nemes (including commas), I'm fine with whatever you
> decide. (If there isn't currently a way to mount a path with commas in it,
> you may consider me complaining.)
>

What you can do is use the new mount API for kernel >=6.5
and provide the parameters one by one, e.g.:

fsconfig(fs_fd, FSCONFIG_SET_STRING, "lowerdir", "/tmp/test-lower,", 0);

See example in commit message of
b36a5780cb44 ("ovl: modify layer parameter parsing")

> But if the status quo remains, I would like an answer to:
>
> >> Is there a new way to escape commas for overlayfs options?
> >>
> >
> > Deferring the question to Christian.
>
> BTW, in case there's a difference between them, the actual code I'm
> working with uses the libc mount() function, not the mount CLI tool. I've
> also experimented with the functions in libmount but they seems to have
> the same problem with commas. Either is fine as long as I can support
> mounting arbitrary path names.
>

The mount tool and libmount in util-linux 2.39 support the new mount API [1].
They already auto detect and fallback to the old mount API, so you wouldn't
need to implement per kernel version logic.

I do not know if the new mount tool would split this string on the escaped \,

-o 'lowerdir=/tmp/test-lower\,,upperdir=/tmp/test-upper,workdir=/tmp/test-work'

But the kernel old mount(2) syscall does NOT escape the , when splitting
the options string into parameters.

ovl used to do it with the old mount API:
91c77947133f ("ovl: allow filenames with comma")

But it does not do that after the conversion to the new mount API,
where generic_parse_monolithic() is used for splitting the parameters.
I prefer not to have to override ->parse_monolithic() for this behavior
if it works as desired for you when using new libmount.

Thanks,
Amir.

[1] http://karelzak.blogspot.com/2023/06/util-linux-v239-improved-mount.html




[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux