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 10:07 PM Ryan Hendrickson
<ryan.hendrickson@xxxxxxxxxxxx> wrote:
>
> At 2023-10-03 12:50+0300, Amir Goldstein <amir73il@xxxxxxxxx> sent:
>
> > 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")
>
> That would be great, but fsconfig doesn't appear to be documented. It's a
> new syscall? What kernel version was it introduced in, and how am I
> supposed to support older kernels?
>

For old kernel would need to use the old mount API.

I don't know about the status of man pages for new mount API,
but you should be able to figure it out from the examples and from
libmount code if you want to try.

> The second part of your message suggests that the answer to older kernel
> support is libmount:
>
> > 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.
>
> Again sounds great, but in the libmount documentation I've been looking at
> [1], there doesn't seem to be a function for setting options individually.
> mnt_context_set_options accepts a comma-delimited string, and
> mnt_optstr_set_option modifies a comma-delimited string. What am I
> missing?

The parsing of the comma-delimited string, if kernel and fs support new
mount API is supposed to be implemented by userspace library.

So the question of whether \, should be escaped in moved from the
kernel to libmount.

I don't know what libmount does - I did not check.
Deferring the question to Karl.

Thanks,
Amir.




[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