diff options
| author | Jeff Layton <jlayton@kernel.org> | 2026-01-08 20:13:12 +0300 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-01-12 12:55:47 +0300 |
| commit | 94a3f60af5dca72fffc041a64d4c3de5a066f98e (patch) | |
| tree | 0ed6f6ddbf64886cc7d8fad31b5430dedd62ec51 | |
| parent | 136b43aa4b16563c8010c90c53303b745340d70f (diff) | |
| download | linux-94a3f60af5dca72fffc041a64d4c3de5a066f98e.tar.xz | |
overlayfs: add setlease file operation
Add the setlease file_operation to ovl_file_operations and
ovl_dir_operations, pointing to generic_setlease. A future patch will
change the default behavior to reject lease attempts with -EINVAL when
there is no setlease file operation defined. Add generic_setlease to
retain the ability to set leases on this filesystem.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260108-setlease-6-20-v1-17-ea4dec9b67fa@kernel.org
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
| -rw-r--r-- | fs/overlayfs/file.c | 2 | ||||
| -rw-r--r-- | fs/overlayfs/readdir.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index cbae89457234..8269431ba3c6 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -5,6 +5,7 @@ #include <linux/cred.h> #include <linux/file.h> +#include <linux/filelock.h> #include <linux/mount.h> #include <linux/xattr.h> #include <linux/uio.h> @@ -647,4 +648,5 @@ const struct file_operations ovl_file_operations = { .copy_file_range = ovl_copy_file_range, .remap_file_range = ovl_remap_file_range, + .setlease = generic_setlease, }; diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index 160960bb0ad0..7fd415d7471e 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c @@ -8,6 +8,7 @@ #include <linux/slab.h> #include <linux/namei.h> #include <linux/file.h> +#include <linux/filelock.h> #include <linux/xattr.h> #include <linux/rbtree.h> #include <linux/security.h> @@ -1070,6 +1071,7 @@ const struct file_operations ovl_dir_operations = { .llseek = ovl_dir_llseek, .fsync = ovl_dir_fsync, .release = ovl_dir_release, + .setlease = generic_setlease, }; int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list) |
