Skip to content

Commit a89ed67

Browse files
committed
Documentation,ovl: document new file descriptor based layers
Add a minimal example how to specify layers via file descriptors. Link: https://lore.kernel.org/r/20241014-work-overlayfs-v3-3-32b3fed1286e@kernel.org Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent a08557d commit a89ed67

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Documentation/filesystems/overlayfs.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,23 @@ For example::
440440
fsconfig(fs_fd, FSCONFIG_SET_STRING, "datadir+", "/do2", 0);
441441

442442

443+
Specifying layers via file descriptors
444+
--------------------------------------
445+
446+
Since kernel v6.13, overlayfs supports specifying layers via file descriptors in
447+
addition to specifying them as paths. This feature is available for the
448+
"datadir+", "lowerdir+", "upperdir", and "workdir+" mount options with the
449+
fsconfig syscall from the new mount api::
450+
451+
fsconfig(fs_fd, FSCONFIG_SET_FD, "lowerdir+", NULL, fd_lower1);
452+
fsconfig(fs_fd, FSCONFIG_SET_FD, "lowerdir+", NULL, fd_lower2);
453+
fsconfig(fs_fd, FSCONFIG_SET_FD, "lowerdir+", NULL, fd_lower3);
454+
fsconfig(fs_fd, FSCONFIG_SET_FD, "datadir+", NULL, fd_data1);
455+
fsconfig(fs_fd, FSCONFIG_SET_FD, "datadir+", NULL, fd_data2);
456+
fsconfig(fs_fd, FSCONFIG_SET_FD, "workdir", NULL, fd_work);
457+
fsconfig(fs_fd, FSCONFIG_SET_FD, "upperdir", NULL, fd_upper);
458+
459+
443460
fs-verity support
444461
-----------------
445462

0 commit comments

Comments
 (0)