Skip to content

Commit ffb3210

Browse files
jtlaytonbrauner
authored andcommitted
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: e6d28eb ("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>
1 parent ce946c4 commit ffb3210

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/ceph/dir.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,13 +2214,15 @@ const struct file_operations ceph_dir_fops = {
22142214
.fsync = ceph_fsync,
22152215
.lock = ceph_lock,
22162216
.flock = ceph_flock,
2217+
.setlease = simple_nosetlease,
22172218
};
22182219

22192220
const struct file_operations ceph_snapdir_fops = {
22202221
.iterate_shared = shared_ceph_readdir,
22212222
.llseek = ceph_dir_llseek,
22222223
.open = ceph_open,
22232224
.release = ceph_release,
2225+
.setlease = simple_nosetlease,
22242226
};
22252227

22262228
const struct inode_operations ceph_dir_iops = {

0 commit comments

Comments
 (0)