All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Fotis Xenakis <foxen@windowslive.com>
Cc: virtio-fs@redhat.com
Subject: Re: [Virtio-fs] [PATCH] Fix file descriptor passed for setupmapping
Date: Mon, 18 May 2020 11:45:26 +0100	[thread overview]
Message-ID: <20200518104526.GC2786@work-vm> (raw)
In-Reply-To: <VI1PR03MB438360F20BFF32EC2AE5ACCEA6BF0@VI1PR03MB4383.eurprd03.prod.outlook.com>

* Fotis Xenakis (foxen@windowslive.com) wrote:
> Currently, during FUSE_SETUPMAPPING, virtiofsd passes the wrong file
> descriptor for the file to mmap() to QEMU (specifically, it passes the
> file handle as requested from the guest).
> 
> This fixes it, using lo_fi_fd() to map the file handle to the right file
> descriptor on the host.
> 
> Signed-off-by: Fotis Xenakis <foxen@windowslive.com>

Thanks!  I've merged this into:
  'DAX: virtiofsd: Make setupmapping work only with inode'

This was a fixup/merging problem - the fd indirection/hiding was done
after the setupmapping; but then the fd indirection got merged first and
the setupmapping put back on top.

Dave

> ---
>  tools/virtiofsd/passthrough_ll.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
> index e09d557d74..44bb24eb5e 100644
> --- a/tools/virtiofsd/passthrough_ll.c
> +++ b/tools/virtiofsd/passthrough_ll.c
> @@ -2709,7 +2709,7 @@ static void lo_setupmapping(fuse_req_t req, fuse_ino_t ino, uint64_t foffset,
>      msg.flags[0] = vhu_flags;
>  
>      if (fi) {
> -        fd = fi->fh;
> +        fd = lo_fi_fd(req, fi);
>      } else {
>          res = asprintf(&buf, "%i", lo_fd(req, ino));
>          if (res == -1) {
> -- 
> 2.26.2
> 
> 
> _______________________________________________
> 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


      parent reply	other threads:[~2020-05-18 10:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 16:33 [Virtio-fs] [PATCH] Fix file descriptor passed for setupmapping Fotis Xenakis
2020-05-15  3:48 ` Liu Bo
2020-05-15 16:50   ` Fotis Xenakis
2020-05-18 12:37     ` Vivek Goyal
2020-05-18 21:17       ` Fotis Xenakis
2020-05-15 12:52 ` Vivek Goyal
2020-05-18 10:45 ` 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=20200518104526.GC2786@work-vm \
    --to=dgilbert@redhat.com \
    --cc=foxen@windowslive.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.