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: e6d28ebc17 ("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>
This commit is contained in:
Jeff Layton 2026-01-07 09:20:11 -05:00 committed by Christian Brauner
parent b9a9be4d35
commit 5d65a70bd0
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -242,6 +242,7 @@ const struct file_operations v9fs_dir_operations = {
.iterate_shared = v9fs_dir_readdir,
.open = v9fs_file_open,
.release = v9fs_dir_release,
.setlease = simple_nosetlease,
};
const struct file_operations v9fs_dir_operations_dotl = {
@ -251,4 +252,5 @@ const struct file_operations v9fs_dir_operations_dotl = {
.open = v9fs_file_open,
.release = v9fs_dir_release,
.fsync = v9fs_file_fsync_dotl,
.setlease = simple_nosetlease,
};