linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC v2 0/4] ovl: specify layers via file descriptors
@ 2024-10-11 21:45 Christian Brauner
  2024-10-11 21:45 ` [PATCH RFC v2 1/4] fs: add helper to use mount option as path or fd Christian Brauner
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Christian Brauner @ 2024-10-11 21:45 UTC (permalink / raw)
  To: Miklos Szeredi, Amir Goldstein
  Cc: Josef Bacik, linux-fsdevel, linux-unionfs, Christian Brauner

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 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 (4):
      fs: add helper to use mount option as path or fd
      ovl: specify layers via file descriptors
      selftests: use shared header
      selftests: add overlayfs fd mounting selftests

 fs/fs_parser.c                                     |  19 ++++
 fs/overlayfs/params.c                              | 106 +++++++++++++-----
 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     | 122 +++++++++++++++++++++
 .../selftests/filesystems/overlayfs/wrappers.h     |  47 ++++++++
 8 files changed, 274 insertions(+), 55 deletions(-)
---
base-commit: 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b
change-id: 20241011-work-overlayfs-dbcfa9223e87


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-10-14  8:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 21:45 [PATCH RFC v2 0/4] ovl: specify layers via file descriptors Christian Brauner
2024-10-11 21:45 ` [PATCH RFC v2 1/4] fs: add helper to use mount option as path or fd Christian Brauner
2024-10-12  7:21   ` Amir Goldstein
2024-10-12  8:20     ` Amir Goldstein
2024-10-14  8:20       ` Christian Brauner
2024-10-11 21:45 ` [PATCH RFC v2 2/4] ovl: specify layers via file descriptors Christian Brauner
2024-10-11 22:27   ` Al Viro
2024-10-12  8:25   ` Amir Goldstein
2024-10-12 10:37     ` Christian Brauner
2024-10-13 14:54       ` Amir Goldstein
2024-10-11 21:45 ` [PATCH RFC v2 3/4] selftests: use shared header Christian Brauner
2024-10-12  7:33   ` Amir Goldstein
2024-10-11 21:45 ` [PATCH RFC v2 4/4] selftests: add overlayfs fd mounting selftests Christian Brauner
2024-10-12  7:18   ` Amir Goldstein

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).