Re: [PATCH 01/25] vfs: syscall: Add fsinfo() to query filesystem information [ver #13]

From: Miklos Szeredi
Date: Wed May 29 2019 - 03:46:26 EST


On Tue, May 28, 2019 at 5:11 PM David Howells <dhowells@xxxxxxxxxx> wrote:
>
> Add a system call to allow filesystem information to be queried. A request
> value can be given to indicate the desired attribute. Support is provided
> for enumerating multi-value attributes.
>

[...]

> +static u32 calc_sb_flags(u32 s_flags)
> +{
> + u32 flags = 0;
> +
> + if (s_flags & SB_RDONLY) flags |= MS_RDONLY;
> + if (s_flags & SB_SYNCHRONOUS) flags |= MS_SYNCHRONOUS;
> + if (s_flags & SB_MANDLOCK) flags |= MS_MANDLOCK;
> + if (s_flags & SB_DIRSYNC) flags |= MS_DIRSYNC;
> + if (s_flags & SB_SILENT) flags |= MS_SILENT;
> + if (s_flags & SB_POSIXACL) flags |= MS_POSIXACL;
> + if (s_flags & SB_LAZYTIME) flags |= MS_LAZYTIME;
> + if (s_flags & SB_I_VERSION) flags |= MS_I_VERSION;

Please don't resurrect MS_ flags. They are from the old API and
shouldn't be used in the new one. Some of them (e.g. MS_POSIXACL,
MS_I_VERSION) are actually internal flags despite being exported on
the old API. And there's SB_SILENT which is simply not a superblock
flag and we might be better getting rid of it entirely.

The proper way to query mount options should be analogous to the way
they are set on the new API: list of {key, type, value, aux} tuples.

Thanks,
Miklos