Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jeff Layton and committed by
Christian Brauner
ffb32104 ce946c4f

+2
+2
fs/ceph/dir.c
··· 2214 2214 .fsync = ceph_fsync, 2215 2215 .lock = ceph_lock, 2216 2216 .flock = ceph_flock, 2217 + .setlease = simple_nosetlease, 2217 2218 }; 2218 2219 2219 2220 const struct file_operations ceph_snapdir_fops = { ··· 2222 2221 .llseek = ceph_dir_llseek, 2223 2222 .open = ceph_open, 2224 2223 .release = ceph_release, 2224 + .setlease = simple_nosetlease, 2225 2225 }; 2226 2226 2227 2227 const struct inode_operations ceph_dir_iops = {