The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] vboxsf: explicitly deny setlease attempts
@ 2024-03-19 16:32 Jeff Layton
  2024-04-03 14:10 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2024-03-19 16:32 UTC (permalink / raw)
  To: Hans de Goede; +Cc: linux-fsdevel, linux-kernel, 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.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
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(+)

diff --git a/fs/vboxsf/file.c b/fs/vboxsf/file.c
index 2307f8037efc..118dedef8ebe 100644
--- a/fs/vboxsf/file.c
+++ b/fs/vboxsf/file.c
@@ -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,
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vboxsf: explicitly deny setlease attempts
  2024-03-19 16:32 [PATCH] vboxsf: explicitly deny setlease attempts Jeff Layton
@ 2024-04-03 14:10 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2024-04-03 14:10 UTC (permalink / raw)
  To: Jeff Layton; +Cc: linux-fsdevel, linux-kernel

Hi,

On 3/19/24 5:32 PM, Jeff Layton wrote:
> 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.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

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




> ---
> 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(+)
> 
> diff --git a/fs/vboxsf/file.c b/fs/vboxsf/file.c
> index 2307f8037efc..118dedef8ebe 100644
> --- a/fs/vboxsf/file.c
> +++ b/fs/vboxsf/file.c
> @@ -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,


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-03 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-19 16:32 [PATCH] vboxsf: explicitly deny setlease attempts Jeff Layton
2024-04-03 14:10 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox