All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Xiao Yang <yangx.jy@cn.fujitsu.com>
Cc: virtio-fs@redhat.com
Subject: Re: [Virtio-fs] [PATCH 1/2] vitriofsd/passthrough_ll: Make fallocate() work
Date: Tue, 14 Jan 2020 12:14:57 +0000	[thread overview]
Message-ID: <20200114121457.GG2812@work-vm> (raw)
In-Reply-To: <20200113093735.4610-1-yangx.jy@cn.fujitsu.com>

* Xiao Yang (yangx.jy@cn.fujitsu.com) wrote:
> 1) Use correct CONFIG_FALLOCATE macro to check if fallocate() is supported.(i.e configure
>    script sets CONFIG_FALLOCATE intead of HAVE_FALLOCATE if fallocate() is supported)
> 2) Avoid 'Bad file descriptor' error by passing correct fd to fallocate().
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
>  tools/virtiofsd/passthrough_ll.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
> index 42a3e182f9..a19823caaf 100644
> --- a/tools/virtiofsd/passthrough_ll.c
> +++ b/tools/virtiofsd/passthrough_ll.c
> @@ -2313,8 +2313,8 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode, off_t offset,
>      struct lo_data *lo = lo_data(req);
>      (void)ino;
>  
> -#ifdef HAVE_FALLOCATE
> -    err = fallocate(fi->fh, mode, offset, length);
> +#ifdef CONFIG_FALLOCATE
> +    err = fallocate(lo_fi_fd(req, fi), mode, offset, length);

Thanks; I've merged the fh fix into Stefan's 'add fd_map to hide file
descriptors'
patch.

I'll merge the ifdef fix with your next fix and take it as a separate 
patch.

Dave

>      if (err < 0) {
>          err = errno;
>      }
> -- 
> 2.21.0
> 
> 
> 
> 
> _______________________________________________
> 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-01-14 12:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13  9:37 [Virtio-fs] [PATCH 1/2] vitriofsd/passthrough_ll: Make fallocate() work Xiao Yang
2020-01-13  9:37 ` [Virtio-fs] [PATCH 2/2] virtiofsd/passthrough_ll: Only call posix_fallocate() when it is supported Xiao Yang
2020-01-14 12:14 ` Dr. David Alan Gilbert [this message]
2020-01-14 12:26   ` [Virtio-fs] [PATCH 1/2] vitriofsd/passthrough_ll: Make fallocate() work Xiao Yang
2020-01-14 12:28     ` Dr. David Alan Gilbert

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=20200114121457.GG2812@work-vm \
    --to=dgilbert@redhat.com \
    --cc=virtio-fs@redhat.com \
    --cc=yangx.jy@cn.fujitsu.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.