From: Jeff Layton <jlayton@kernel.org>
To: Christian Brauner <brauner@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Jan Kara <jack@suse.cz>
Cc: Josef Bacik <josef@toxicpanda.com>,
Miklos Szeredi <miklos@szeredi.hu>, Ian Kent <raven@themaw.net>,
David Howells <dhowells@redhat.com>,
Amir Goldstein <amir73il@gmail.com>,
Paul Moore <paul@paul-moore.com>, Karel Zak <kzak@redhat.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Jeff Layton <jlayton@kernel.org>
Subject: [PATCH v2 0/2] fs: listmount()/statmount() fix and sample program
Date: Fri, 15 Nov 2024 10:35:51 -0500 [thread overview]
Message-ID: <20241115-statmount-v2-0-cd29aeff9cbb@kernel.org> (raw)
We had some recent queries internally asking how to use the new
statmount() and listmount() interfaces. I was doing some other work in
this area, so I whipped up this tool.
My hope is that this will represent something of a "rosetta stone" for
how to translate between mountinfo and statmount(), and an example for
other people looking to use the new interfaces.
It may also be possible to use this as the basis for a listmount() and
statmount() testcase. We can call this program, and compare its output
to the mountinfo file.
The second patch adds security mount options to the existing mnt_opts in
the statmount() interface, which I think is the final missing piece
here. The alternative to doing that would be to add a new string field
for that, but I'm not sure that's worthwhile.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Changes in v2:
- fixed off-by-one bug in listmount last_mnt_id handling
- patch to add the security mount options to statmount()
- Link to v1: https://lore.kernel.org/r/20241112-statmount-v1-1-d98090c4c8be@kernel.org
---
Jeff Layton (2):
samples: add a mountinfo program to demonstrate statmount()/listmount()
fs: prepend statmount.mnt_opts string with security_sb_mnt_opts()
fs/namespace.c | 4 +
samples/vfs/.gitignore | 1 +
samples/vfs/Makefile | 2 +-
samples/vfs/mountinfo.c | 271 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 277 insertions(+), 1 deletion(-)
---
base-commit: 4be4eaeb1a60a7d52e66123f2f52f2da017c9881
change-id: 20241112-statmount-77808bc02302
Best regards,
--
Jeff Layton <jlayton@kernel.org>
next reply other threads:[~2024-11-15 15:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-15 15:35 Jeff Layton [this message]
2024-11-15 15:35 ` [PATCH v2 1/2] samples: add a mountinfo program to demonstrate statmount()/listmount() Jeff Layton
2024-11-15 15:35 ` [PATCH v2 2/2] fs: prepend statmount.mnt_opts string with security_sb_mnt_opts() Jeff Layton
2024-11-20 8:23 ` [PATCH v2 0/2] fs: listmount()/statmount() fix and sample program Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241115-statmount-v2-0-cd29aeff9cbb@kernel.org \
--to=jlayton@kernel.org \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=dhowells@redhat.com \
--cc=jack@suse.cz \
--cc=josef@toxicpanda.com \
--cc=kzak@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=paul@paul-moore.com \
--cc=raven@themaw.net \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox