From: David Howells <dhowells@redhat.com>
To: viro@zeniv.linux.org.uk
Cc: linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org,
dhowells@redhat.com, torvalds@linux-foundation.org,
ebiederm@xmission.com, linux-security-module@vger.kernel.org
Subject: [PATCH 00/10] VFS: Provide new mount UAPI
Date: Tue, 19 Feb 2019 17:08:23 +0000 [thread overview]
Message-ID: <155059610368.17079.2220554006494174417.stgit@warthog.procyon.org.uk> (raw)
Here's a set of patches that creates a number of new system calls to allow
the creation and parameterisation of a filesystem context and the
subsequent use of that context to create or look up a superblock:
fd = fsopen("afs");
fsconfig(fd, FSCONFIG_SET_STRING,
"source", "#grand.central.org:root.cell.", 0);
fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0);
or reconfigure a superblock:
fd = fspick(AT_FDCWD, "/nfs/foo", FSPICK_NO_AUTOMOUNT);
fsconfig(fd, FSCONFIG_SET_FLAG, "noac", NULL, 0);
fsconfig(fd, FSCONFIG_CMD_RECONFIGURE, NULL, NULL, 0);
A mount object can then be created for the superblock which will be
attached to an O_PATH-equivalent file descriptor:
mfd = fsmount(fd, MS_NODEV);
This can then be moved into place:
move_mount(mfd, "", AT_FDCWD, "/mnt", MOVE_MOUNT_F_EMPTY_PATH);
move_mount() can be used more generically too, e.g.:
move_mount(AT_FDCWD, "/mnt/foo", AT_FDCWD, "/mnt/bar", 0);
to move mount subtrees around.
One more system call is available:
mfd = open_tree(AT_FDCWD, "/mnt/foo", 0)
mfd = open_tree(AT_FDCWD, "/mnt/foo", OPEN_TREE_CLONE)
mfd = open_tree(AT_FDCWD, "/mnt/foo", OPEN_TREE_CLONE | AT_RECURSIVE)
This creates an O_PATH-equivalent file descriptor referring to a mount, a
copy of a mount or a copy of a mount subtree that move_mount() can then
move/paste into place.
The patches can be found here also:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
at tag:
vfs-mount-syscalls
David
---
Al Viro (1):
vfs: syscall: Add open_tree(2) to reference or clone a mount
David Howells (9):
vfs: syscall: Add move_mount(2) to move mounts around
teach move_mount(2) to work with OPEN_TREE_CLONE
Make anon_inodes unconditional
vfs: syscall: Add fsopen() to prepare for superblock creation
vfs: Implement logging through fs_context
vfs: syscall: Add fsconfig() for configuring and managing a context
vfs: syscall: Add fsmount() to create a mount for a superblock
vfs: syscall: Add fspick() to select a superblock for reconfiguration
vfs: Add a sample program for the new mount API
arch/arm/kvm/Kconfig | 1
arch/arm64/kvm/Kconfig | 1
arch/mips/kvm/Kconfig | 1
arch/powerpc/kvm/Kconfig | 1
arch/s390/kvm/Kconfig | 1
arch/x86/Kconfig | 1
arch/x86/entry/syscalls/syscall_32.tbl | 6
arch/x86/entry/syscalls/syscall_64.tbl | 6
arch/x86/kvm/Kconfig | 1
drivers/base/Kconfig | 1
drivers/char/tpm/Kconfig | 1
drivers/dma-buf/Kconfig | 1
drivers/gpio/Kconfig | 1
drivers/iio/Kconfig | 1
drivers/infiniband/Kconfig | 1
drivers/vfio/Kconfig | 1
fs/Makefile | 4
fs/file_table.c | 9 -
fs/fs_context.c | 160 ++++++++++-
fs/fsopen.c | 477 ++++++++++++++++++++++++++++++++
fs/internal.h | 4
fs/namespace.c | 477 ++++++++++++++++++++++++++++----
fs/notify/fanotify/Kconfig | 1
fs/notify/inotify/Kconfig | 1
include/linux/fs.h | 7
include/linux/fs_context.h | 38 ++-
include/linux/lsm_hooks.h | 6
include/linux/module.h | 6
include/linux/security.h | 7
include/linux/syscalls.h | 9 +
include/uapi/linux/fcntl.h | 2
include/uapi/linux/mount.h | 62 ++++
init/Kconfig | 10 -
samples/Kconfig | 9 -
samples/Makefile | 2
samples/statx/Makefile | 7
samples/statx/test-statx.c | 258 -----------------
samples/vfs/Makefile | 10 +
samples/vfs/test-fsmount.c | 133 +++++++++
samples/vfs/test-statx.c | 267 ++++++++++++++++++
security/security.c | 5
41 files changed, 1617 insertions(+), 380 deletions(-)
create mode 100644 fs/fsopen.c
delete mode 100644 samples/statx/Makefile
delete mode 100644 samples/statx/test-statx.c
create mode 100644 samples/vfs/Makefile
create mode 100644 samples/vfs/test-fsmount.c
create mode 100644 samples/vfs/test-statx.c
next reply other threads:[~2019-02-19 17:08 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-19 17:08 David Howells [this message]
2019-02-19 17:08 ` [PATCH 01/10] vfs: syscall: Add open_tree(2) to reference or clone a mount David Howells
2019-02-19 17:08 ` [PATCH 02/10] vfs: syscall: Add move_mount(2) to move mounts around David Howells
2019-02-20 12:32 ` Alan Jenkins
2019-02-20 12:41 ` Alan Jenkins
2019-02-20 16:23 ` Jann Horn
2019-07-08 12:02 ` Tetsuo Handa
2019-07-08 13:18 ` Al Viro
2019-07-08 17:12 ` Eric W. Biederman
2019-07-08 18:01 ` Al Viro
2019-07-08 18:13 ` Al Viro
2019-07-08 20:21 ` Al Viro
2019-07-09 0:13 ` Eric W. Biederman
2019-07-09 10:51 ` Tetsuo Handa
2019-07-22 10:12 ` Tetsuo Handa
2019-07-23 4:16 ` John Johansen
2019-07-23 13:45 ` Tetsuo Handa
2019-08-06 10:43 ` Tetsuo Handa
2019-08-22 3:51 ` [RFC][PATCH] fix d_absolute_path() interplay with fsmount() Al Viro
2019-08-30 10:11 ` Tetsuo Handa
2019-07-23 21:45 ` [PATCH 02/10] vfs: syscall: Add move_mount(2) to move mounts around James Morris
2019-07-23 23:30 ` Al Viro
2019-02-19 17:08 ` [PATCH 03/10] teach move_mount(2) to work with OPEN_TREE_CLONE David Howells
2019-02-20 18:59 ` Alan Jenkins
2019-02-26 17:45 ` Alan Jenkins
2019-02-19 17:08 ` [PATCH 04/10] Make anon_inodes unconditional David Howells
2019-02-19 17:09 ` [PATCH 05/10] vfs: syscall: Add fsopen() to prepare for superblock creation David Howells
2019-02-19 17:09 ` [PATCH 06/10] vfs: Implement logging through fs_context David Howells
2019-02-19 17:09 ` [PATCH 07/10] vfs: syscall: Add fsconfig() for configuring and managing a context David Howells
2019-02-19 17:09 ` [PATCH 08/10] vfs: syscall: Add fsmount() to create a mount for a superblock David Howells
2019-02-19 17:09 ` [PATCH 09/10] vfs: syscall: Add fspick() to select a superblock for reconfiguration David Howells
2019-02-19 17:09 ` [PATCH 10/10] vfs: Add a sample program for the new mount API David Howells
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=155059610368.17079.2220554006494174417.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=ebiederm@xmission.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--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;
as well as URLs for NNTP newsgroup(s).