All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Liu Bo <bo.liu@linux.alibaba.com>, mszeredi@redhat.com
Cc: virtio-fs@redhat.com
Subject: Re: [Virtio-fs] [PATCH 4/4] virtiofsd: use fallocate(2) instead posix_fallocate(3)
Date: Wed, 17 Apr 2019 14:18:49 +0100	[thread overview]
Message-ID: <20190417131848.GC2839@work-vm> (raw)
In-Reply-To: <20190416190858.16833-5-bo.liu@linux.alibaba.com>

* Liu Bo (bo.liu@linux.alibaba.com) wrote:
> From: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
> 
> This is because posix_fallocate(3) does not support FALLOC_FL_KEEP_SIZE
> and FALLOC_FL_PUNCH_HOLE. Our underlying host filesystem is ext4 and
> ext4 supports FALLOC_FL_KEEP_SIZE and FALLOC_FL_PUNCH_HOLE well, so
> this change will be ok.
> 
> Signed-off-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>

  We need to check what 'fuse' expects - is it defined what
fallocate features it has, and what the semantics are?

Miklos: Do you know?

Dave

  
> ---
>  contrib/virtiofsd/passthrough_ll.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthrough_ll.c
> index 10ea8aa..ccb5312 100644
> --- a/contrib/virtiofsd/passthrough_ll.c
> +++ b/contrib/virtiofsd/passthrough_ll.c
> @@ -1568,15 +1568,10 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode,
>  			 off_t offset, off_t length, struct fuse_file_info *fi)
>  {
>  	int err;
> -	(void) ino;
> -
> -	if (mode) {
> -		fuse_reply_err(req, EOPNOTSUPP);
> -		return;
> -	}
>  
> -	err = posix_fallocate(lo_fi_fd(req, fi), offset,
> -			      length);
> +	err = fallocate(lo_fi_fd(req, fi), mode, offset, length);
> +        if (err < 0)
> +                err = errno;
>  
>  	fuse_reply_err(req, err);
>  }
> -- 
> 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


  reply	other threads:[~2019-04-17 13:18 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 19:08 [Virtio-fs] [PATCH 0/4] virtiofsd fixes Liu Bo
2019-04-16 19:08 ` [Virtio-fs] [PATCH 1/4] virtiofsd: send reply correctly on read failure Liu Bo
2019-04-17 17:26   ` Dr. David Alan Gilbert
2019-04-18 12:25     ` Dr. David Alan Gilbert
2019-04-18 18:14       ` Liu Bo
2019-04-18 19:05         ` Dr. David Alan Gilbert
2019-04-23  6:27   ` [Virtio-fs] [PATCH v2] " Eryu Guan
2019-04-30 14:58     ` Dr. David Alan Gilbert
2019-04-16 19:08 ` [Virtio-fs] [PATCH 2/4] virtiofsd: support nanosecond resolution for file timestamp Liu Bo
2019-04-17 13:31   ` Dr. David Alan Gilbert
2019-04-16 19:08 ` [Virtio-fs] [PATCH 3/4] virtiofsd: use file-backend memory region for virtiofsd's cache area Liu Bo
2019-04-17 14:51   ` Dr. David Alan Gilbert
2019-04-23 12:09     ` Stefan Hajnoczi
2019-04-23 18:49       ` Liu Bo
2019-04-25 14:33         ` Stefan Hajnoczi
2019-04-25 21:21           ` Vivek Goyal
2019-04-26  9:05             ` Stefan Hajnoczi
2019-05-01 18:59               ` Dr. David Alan Gilbert
2019-05-02 11:46                 ` Stefan Hajnoczi
2019-05-18  2:28               ` Liu Bo
2019-05-20 13:49                 ` Vivek Goyal
2019-05-20 18:33                   ` Liu Bo
2019-05-20 19:01                     ` Dr. David Alan Gilbert
2019-05-20 17:58                 ` Dr. David Alan Gilbert
2019-04-16 19:08 ` [Virtio-fs] [PATCH 4/4] virtiofsd: use fallocate(2) instead posix_fallocate(3) Liu Bo
2019-04-17 13:18   ` Dr. David Alan Gilbert [this message]
2019-04-17 13:44     ` Miklos Szeredi
2019-04-17 14:05       ` Dr. David Alan Gilbert
2019-04-17 14:25         ` Miklos Szeredi
2019-04-17 14:29           ` Dr. David Alan Gilbert
2019-04-17 19:24             ` Liu Bo

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=20190417131848.GC2839@work-vm \
    --to=dgilbert@redhat.com \
    --cc=bo.liu@linux.alibaba.com \
    --cc=mszeredi@redhat.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.