Skip to content

Add the ability to query mount options in statmount

Josef Bacik linux-fsdevel 1 version Applied

Status from this message: Applied to the vfs.mount branch of the vfs/vfs.git tree.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 19 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4fs: rename show_mnt_opts -> show_vfsmnt_optsfs/proc_namespace.c+3 -30 replies
2/4fs: add a helper to show all the options for a mountfs/internal.h fs/proc_namespace.c+23 -72 replies
3/4fs: export mount options via statmount()fs/namespace.c include/uapi/linux/mount.h+9 -10 replies
4/4sefltests: extend the statmount test for mount optionstools/testing/selftests/filesystems/statmount/statmount_test.c+130 -10 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJeff Layton
SeriesR-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] Add the ability to query mount options in statmount

Hello,

Currently if you want to get mount options for a mount and you're using statmount(), you still have to open /proc/mounts to parse the mount options. statmount() does have the ability to store an arbitrary string however, additionally the way we do that is with a seq_file, which is also how we use ->show_options for the individual file systems.

Extent statmount() to have a flag for fetching the mount options of a mount. This allows users to not have to parse /proc mount for anything related to a mount. I've extended the existing statmount() test to validate this feature works as expected. As you can tell from the ridiculous amount of silly string parsing, this is a huge win for users and climate change as we will no longer have to waste several cycles parsing strings anymore.

This is based on my branch that extends listmount/statmount to walk into foreign namespaces. Below are links to that posting, that branch, and this branch to make it easier to review.

https://lore.kernel.org/linux-fsdevel/[email protected]/
https://github.com/josefbacik/linux/tree/listmount.combined
https://github.com/josefbacik/linux/tree/statmount-opts

Thanks,

Josef

Josef Bacik (4):
fs: rename show_mnt_opts -> show_vfsmnt_opts
fs: add a helper to show all the options for a mount
fs: export mount options via statmount()
sefltests: extend the statmount test for mount options

 fs/internal.h                                 |   5 +
 fs/namespace.c                                |   7 +
 fs/proc_namespace.c                           |  29 ++--
 include/uapi/linux/mount.h                    |   3 +-
 .../filesystems/statmount/statmount_test.c    | 131 +++++++++++++++++-
 5 files changed, 164 insertions(+), 11 deletions(-)
Signature · 1 line
2.43.0