[PATCH 6/6] vboxsf: don't allow delegations to be set on directories

Jeff Layton
2026-01-07T14:20:48Z

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>
---
fs/vboxsf/dir.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/vboxsf/dir.c b/fs/vboxsf/dir.c
index 42bedc4ec7af7709c564a7174805d185ce86f854..230d7589d15cc98f6bc7e930ba40ca5f7dbf7e18 100644
--- a/fs/vboxsf/dir.c
+++ b/fs/vboxsf/dir.c
@@ -186,6 +186,7 @@ const struct file_operations vboxsf_dir_fops = {
.release = vboxsf_dir_release,
.read = generic_read_dir,
.llseek = generic_file_llseek,
+ .setlease = simple_nosetlease,
};

/*

--
2.52.0