From: Christian Brauner <brauner@kernel.org>
To: Miklos Szeredi <miklos@szeredi.hu>, Amir Goldstein <amir73il@gmail.com>
Cc: Josef Bacik <josef@toxicpanda.com>,
linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org,
Christian Brauner <brauner@kernel.org>
Subject: [PATCH v3 0/5] ovl: file descriptors based layer setup
Date: Mon, 14 Oct 2024 11:40:55 +0200 [thread overview]
Message-ID: <20241014-work-overlayfs-v3-0-32b3fed1286e@kernel.org> (raw)
Hey,
Currently overlayfs only allows specifying layers through path names.
This is inconvenient for users such as systemd that want to assemble an
overlayfs mount purely based on file descriptors.
When porting overlayfs to the new mount api I already mentioned this.
This enables user to specify both:
fsconfig(fd_overlay, FSCONFIG_SET_FD, "upperdir+", NULL, fd_upper);
fsconfig(fd_overlay, FSCONFIG_SET_FD, "workdir+", NULL, fd_work);
fsconfig(fd_overlay, FSCONFIG_SET_FD, "lowerdir+", NULL, fd_lower1);
fsconfig(fd_overlay, FSCONFIG_SET_FD, "lowerdir+", NULL, fd_lower2);
in addition to:
fsconfig(fd_overlay, FSCONFIG_SET_STRING, "upperdir+", "/upper", 0);
fsconfig(fd_overlay, FSCONFIG_SET_STRING, "workdir+", "/work", 0);
fsconfig(fd_overlay, FSCONFIG_SET_STRING, "lowerdir+", "/lower1", 0);
fsconfig(fd_overlay, FSCONFIG_SET_STRING, "lowerdir+", "/lower2", 0);
The selftest contains an example for this.
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
Changes in v3:
- Add documentation into overlayfs.rst.
- Rename new mount api parsing helper.
- Change cleanup scope in helper.
- Link to v2: https://lore.kernel.org/r/20241011-work-overlayfs-v2-0-1b43328c5a31@kernel.org
Changes in v2:
- Alias fd and path based mount options.
- Link to v1: https://lore.kernel.org/r/20241011-work-overlayfs-v1-0-e34243841279@kernel.org
---
Christian Brauner (5):
fs: add helper to use mount option as path or fd
ovl: specify layers via file descriptors
Documentation,ovl: document new file descriptor based layers
selftests: use shared header
selftests: add overlayfs fd mounting selftests
Documentation/filesystems/overlayfs.rst | 17 +++
fs/fs_parser.c | 20 +++
fs/overlayfs/params.c | 116 ++++++++++++----
include/linux/fs_parser.h | 5 +-
.../selftests/filesystems/overlayfs/.gitignore | 1 +
.../selftests/filesystems/overlayfs/Makefile | 2 +-
.../selftests/filesystems/overlayfs/dev_in_maps.c | 27 +---
.../filesystems/overlayfs/set_layers_via_fds.c | 152 +++++++++++++++++++++
.../selftests/filesystems/overlayfs/wrappers.h | 47 +++++++
9 files changed, 334 insertions(+), 53 deletions(-)
---
base-commit: 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b
change-id: 20241011-work-overlayfs-dbcfa9223e87
next reply other threads:[~2024-10-14 9:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 9:40 Christian Brauner [this message]
2024-10-14 9:40 ` [PATCH v3 1/5] fs: add helper to use mount option as path or fd Christian Brauner
2024-10-14 9:40 ` [PATCH v3 2/5] ovl: specify layers via file descriptors Christian Brauner
2024-10-18 9:42 ` Miklos Szeredi
2024-10-18 10:34 ` Christian Brauner
2024-10-14 9:40 ` [PATCH v3 3/5] Documentation,ovl: document new file descriptor based layers Christian Brauner
2024-10-14 9:40 ` [PATCH v3 4/5] selftests: use shared header Christian Brauner
2024-10-14 9:41 ` [PATCH v3 5/5] selftests: add overlayfs fd mounting selftests Christian Brauner
2024-10-14 14:16 ` [PATCH v3 0/5] ovl: file descriptors based layer setup Amir Goldstein
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=20241014-work-overlayfs-v3-0-32b3fed1286e@kernel.org \
--to=brauner@kernel.org \
--cc=amir73il@gmail.com \
--cc=josef@toxicpanda.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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).