All of lore.kernel.org
 help / color / mirror / Atom feed
* [Virtio-fs] [PATCH][virtio-fs-dev] virtiofsd: Fix fuse_reply_create() to determine correct length of buffer
@ 2019-07-03 20:32 Vivek Goyal
  2019-07-08 18:42 ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 2+ messages in thread
From: Vivek Goyal @ 2019-07-03 20:32 UTC (permalink / raw)
  To: virtio-fs-list, Dr. David Alan Gilbert

Hi Dave,

Following patch needs to be applied on virtio-fs-dev branch to make it
work with latest kernel. Otherwise file creation reply returns error.

Thanks
Vivek

Put conditional express in brackets. Otherwise expression being evaluated
becomes (entrysize + sizeof(struct fuse_open_out) + shared) instead and
which obviously results in wrong size calculation.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 contrib/virtiofsd/fuse_lowlevel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: qemu/contrib/virtiofsd/fuse_lowlevel.c
===================================================================
--- qemu.orig/contrib/virtiofsd/fuse_lowlevel.c	2019-07-01 13:22:55.489623969 -0400
+++ qemu/contrib/virtiofsd/fuse_lowlevel.c	2019-07-01 13:23:56.338143585 -0400
@@ -413,7 +413,7 @@ int fuse_reply_create(fuse_req_t req, co
 	ever->version_index = e->version_offset;
 	return send_reply_ok(req, buf,
 			     entrysize + sizeof(struct fuse_open_out) +
-                             shared ? sizeof(struct fuse_entryver_out) : 0);
+                             (shared ? sizeof(struct fuse_entryver_out) : 0));
 }
 
 int fuse_reply_attr(fuse_req_t req, const struct stat *attr,


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

* Re: [Virtio-fs] [PATCH][virtio-fs-dev] virtiofsd: Fix fuse_reply_create() to determine correct length of buffer
  2019-07-03 20:32 [Virtio-fs] [PATCH][virtio-fs-dev] virtiofsd: Fix fuse_reply_create() to determine correct length of buffer Vivek Goyal
@ 2019-07-08 18:42 ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 2+ messages in thread
From: Dr. David Alan Gilbert @ 2019-07-08 18:42 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: virtio-fs-list

* Vivek Goyal (vgoyal@redhat.com) wrote:
> Hi Dave,
> 
> Following patch needs to be applied on virtio-fs-dev branch to make it
> work with latest kernel. Otherwise file creation reply returns error.
> 
> Thanks
> Vivek
> 
> Put conditional express in brackets. Otherwise expression being evaluated
> becomes (entrysize + sizeof(struct fuse_open_out) + shared) instead and
> which obviously results in wrong size calculation.
> 
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>

Ouch, that's a nasty one to find; thanks!

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  contrib/virtiofsd/fuse_lowlevel.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: qemu/contrib/virtiofsd/fuse_lowlevel.c
> ===================================================================
> --- qemu.orig/contrib/virtiofsd/fuse_lowlevel.c	2019-07-01 13:22:55.489623969 -0400
> +++ qemu/contrib/virtiofsd/fuse_lowlevel.c	2019-07-01 13:23:56.338143585 -0400
> @@ -413,7 +413,7 @@ int fuse_reply_create(fuse_req_t req, co
>  	ever->version_index = e->version_offset;
>  	return send_reply_ok(req, buf,
>  			     entrysize + sizeof(struct fuse_open_out) +
> -                             shared ? sizeof(struct fuse_entryver_out) : 0);
> +                             (shared ? sizeof(struct fuse_entryver_out) : 0));
>  }
>  
>  int fuse_reply_attr(fuse_req_t req, const struct stat *attr,
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


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

end of thread, other threads:[~2019-07-08 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-03 20:32 [Virtio-fs] [PATCH][virtio-fs-dev] virtiofsd: Fix fuse_reply_create() to determine correct length of buffer Vivek Goyal
2019-07-08 18:42 ` Dr. David Alan Gilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.