Skip to content

Commit 5d65a70

Browse files
jtlaytonbrauner
authored andcommitted
9p: 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-3-85f034abcc57@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent b9a9be4 commit 5d65a70

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/9p/vfs_dir.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ const struct file_operations v9fs_dir_operations = {
242242
.iterate_shared = v9fs_dir_readdir,
243243
.open = v9fs_file_open,
244244
.release = v9fs_dir_release,
245+
.setlease = simple_nosetlease,
245246
};
246247

247248
const struct file_operations v9fs_dir_operations_dotl = {
@@ -251,4 +252,5 @@ const struct file_operations v9fs_dir_operations_dotl = {
251252
.open = v9fs_file_open,
252253
.release = v9fs_dir_release,
253254
.fsync = v9fs_file_fsync_dotl,
255+
.setlease = simple_nosetlease,
254256
};

0 commit comments

Comments
 (0)