Skip to contentSkip to conversation

vboxsf: explicitly deny setlease attempts

PATCH Superseded Jeff Layton 2 participants 2 messages Mar 19, 2024 – Apr 3, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vboxsf: explicitly deny setlease attempts

vboxsf does not break leases on its own, so it can't properly handle the case where the hypervisor changes the data. Don't allow file leases on vboxsf.

---
Looking over the comments in the code around cache coherency, it seems like it ought to deny file locks as well? We could add a stub ->lock routine that just returns -ENOLCK or something.

---
 fs/vboxsf/file.c | 1 +
 1 file changed, 1 insertion(+)
fs/vboxsf/file.c +1 -0
index 2307f8037efc..118dedef8ebe 100644
@@ -218,6 +218,7 @@ const struct file_operations vboxsf_reg_fops = {
 	.release = vboxsf_file_release,
 	.fsync = noop_fsync,
 	.splice_read = filemap_splice_read,
+	.setlease = simple_nosetlease,
 };
 
 const struct inode_operations vboxsf_reg_iops = {

---
base-commit: 0a7b0acecea273c8816f4f5b0e189989470404cf
change-id: 20240319-setlease-ce31fb8777b0

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 5 lines · Jeff Layton

vboxsf does not break leases on its own, so it can't properly handle the case where the hypervisor changes the data. Don't allow file leases on vboxsf.

Thanks, patch looks good to me:

I have added this to my local vboxsf branch now and I'll send out a pull-request with this and a couple of other vboxsf fixes soon.

Regards,

Hans

Quoted 26 lines

---
Looking over the comments in the code around cache coherency, it seems like it ought to deny file locks as well? We could add a stub ->lock routine that just returns -ENOLCK or something.

---
 fs/vboxsf/file.c | 1 +
 1 file changed, 1 insertion(+)
fs/vboxsf/file.c +1 -1
index 2307f8037efc..118dedef8ebe 100644
@@ -218,6 +218,7 @@ const struct file_operations vboxsf_reg_fops = {
 	.release = vboxsf_file_release,
 	.fsync = noop_fsync,
 	.splice_read = filemap_splice_read,
+	.setlease = simple_nosetlease,
 };
 
 const struct inode_operations vboxsf_reg_iops = {
 
---

base-commit: 0a7b0acecea273c8816f4f5b0e189989470404cf
change-id: 20240319-setlease-ce31fb8777b0

Best regards,