summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2026-01-07 17:20:13 +0300
committerChristian Brauner <brauner@kernel.org>2026-01-12 12:54:47 +0300
commitffb321045b0f1cd8bcea215269fbaa17c12da038 (patch)
treed2783a4f399d9a09f501f64966f8ac78871a2014
parentce946c4fb98c95519ee39ab7d4b117ff15f09efa (diff)
downloadlinux-ffb321045b0f1cd8bcea215269fbaa17c12da038.tar.xz
ceph: don't allow delegations to be set on directories
With the advent of directory leases, it's necessary to set the ->setlease() handler in directory file_operations to properly deny them. Fixes: e6d28ebc17eb ("filelock: push the S_ISREG check down to ->setlease handlers") Signed-off-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260107-setlease-6-19-v1-5-85f034abcc57@kernel.org Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--fs/ceph/dir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 86d7aa594ea9..804588524cd5 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -2214,6 +2214,7 @@ const struct file_operations ceph_dir_fops = {
.fsync = ceph_fsync,
.lock = ceph_lock,
.flock = ceph_flock,
+ .setlease = simple_nosetlease,
};
const struct file_operations ceph_snapdir_fops = {
@@ -2221,6 +2222,7 @@ const struct file_operations ceph_snapdir_fops = {
.llseek = ceph_dir_llseek,
.open = ceph_open,
.release = ceph_release,
+ .setlease = simple_nosetlease,
};
const struct inode_operations ceph_dir_iops = {