From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Liu Bo <bo.liu@linux.alibaba.com>
Cc: virtio-fs@redhat.com
Subject: Re: [Virtio-fs] [PATCH] virtiofsd: fix multiple unmappable writes from writev in fuse
Date: Thu, 23 May 2019 16:52:36 +0100 [thread overview]
Message-ID: <20190523155236.GC2995@work-vm> (raw)
In-Reply-To: <1558573595-119159-1-git-send-email-bo.liu@linux.alibaba.com>
* Liu Bo (bo.liu@linux.alibaba.com) wrote:
> Commit (a2c2817 virtiofsd: Parse unmappable elements) assumes that there
> is only one iovec in "out", which is not true if a writev with multiple
> write iovec is done from fuse.
>
> This fills the gap.
>
> Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Thanks! I've squashed this down into my 'Parse unmappable elements'
Dave
> ---
> contrib/virtiofsd/fuse_virtio.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/virtiofsd/fuse_virtio.c b/contrib/virtiofsd/fuse_virtio.c
> index 8306ed5..cb46558 100644
> --- a/contrib/virtiofsd/fuse_virtio.c
> +++ b/contrib/virtiofsd/fuse_virtio.c
> @@ -557,7 +557,7 @@ static void *fv_queue_thread(void *opaque)
> if (bad_in_num || bad_out_num) {
> bool handled_unmappable = false;
>
> - if (out_num > 2 && out_num_readable == 2 && !bad_in_num &&
> + if (out_num > 2 && out_num_readable >= 2 && !bad_in_num &&
> out_sg[0].iov_len == sizeof(struct fuse_in_header) &&
> ((struct fuse_in_header *)fbuf.mem)->opcode ==
> FUSE_WRITE &&
> @@ -585,7 +585,7 @@ static void *fv_queue_thread(void *opaque)
> for(; iovindex < out_num; iovindex++, pbufvindex++) {
> pbufv->count++;
> pbufv->buf[pbufvindex].pos = ~0; // Dummy
> - pbufv->buf[pbufvindex].flags = FUSE_BUF_PHYS_ADDR;
> + pbufv->buf[pbufvindex].flags = (iovindex < out_num_readable) ? 0 : FUSE_BUF_PHYS_ADDR;
> pbufv->buf[pbufvindex].mem = out_sg[iovindex].iov_base;
> pbufv->buf[pbufvindex].size = out_sg[iovindex].iov_len;
> }
> --
> 1.8.3.1
>
> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs@redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
prev parent reply other threads:[~2019-05-23 15:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-23 1:06 [Virtio-fs] [PATCH] virtiofsd: fix multiple unmappable writes from writev in fuse Liu Bo
2019-05-23 15:52 ` Dr. David Alan Gilbert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190523155236.GC2995@work-vm \
--to=dgilbert@redhat.com \
--cc=bo.liu@linux.alibaba.com \
--cc=virtio-fs@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.