On 29/3/23 02:48, Karel Zak wrote:
On Fri, Mar 24, 2023 at 01:39:09PM +0800, Ian Kent wrote:
Karel do you find what I'm saying is accurate?
Do you think we will be able to get rid of the sloppy option over
time with the move to use the mount API?
The question is what we're talking about :-)
For mount(8) and libmount, there is nothing like the "sloppy" mount option.
If you use it in your fstab or as "mount -o sloppy" on the command line,
then it's used as any other fs-specific mount option; the library copies
the string to mount(2) or fsconfig(2) syscall. The library has no clue
what the string means (it's the same as "mount -o foobar").
Which is what the problem really is.
If anyone uses this option with a file system that has previously
allowed it then mounts fail if it isn't handled properly. Then the
intended purpose of it is irrelevant because it causes a fail.
I guess the notion of ignoring it for fsconfig(), assuming it isn't
actually needed for the option handling, might not be a viable idea
... although I haven't actually added that to fsconfig(), I probably
should add that to this series.
But first the question of whether the option is actually needed anymore
by those that allow it needs to be answered.
In case anyone has forgotten it was introduced because, at one time
different OSes supported slightly different options for for the same
thing and one could not include multiple options for the same thing
in automount map entries without causing the mount to fail.
So we also need to answer, is this option conflict still present for
any of the file systems that allow it, currently nfs, cifs and ntfs
(I'll need to look up the ntfs maintainer but lets answer this for
nfs and cifs first).
If it isn't actually needed ignoring it in fsconfig() (a deprecation
warning would be in order) and eventually getting rid of it would be
a good idea, yes?
But there is another "sloppy" :-) The command line argument, "mount -s".
This argument is not internally used by libmount or mount(8), but it's
repeated on /sbin/mount.<type> command lines (e.g., "mount -t nfs -s"
means "/sbin/mount.nfs -s").
I guess more interesting is mount.nfs, where both "-s" and "sloppy" lives
together. The mount.nfs uses this option to be tolerant when parsing mount
options string, and it also seems it converts "-s" to "sloppy" string for
mount syscall.
I don't think it makes any difference given the original purpose of
it but hopefully Steve will know/remember.
So, for mount(8)/libmount, digging a grave for the "sloppy" will be trivial.
All I need is to add a note about depreciation to the man page and later
remove "-s" from /sbin/mount.<type> command line.
Right.
SteveD (in CC:) will comment on it from the NFS point of view because the
real fun happens there :-)
Yep.
Thanks,
Ian