[Virtio-fs] [PATCH 4/4] virtiofsd: use fallocate(2) instead posix_fallocate(3)

Liu Bo bo.liu at linux.alibaba.com
Wed Apr 17 19:24:59 UTC 2019


On Wed, Apr 17, 2019 at 03:29:00PM +0100, Dr. David Alan Gilbert wrote:
> * Miklos Szeredi (mszeredi at redhat.com) wrote:
> > On Wed, Apr 17, 2019 at 4:05 PM Dr. David Alan Gilbert
> > <dgilbert at redhat.com> wrote:
> > >
> > > * Miklos Szeredi (mszeredi at redhat.com) wrote:
> > > > On Wed, Apr 17, 2019 at 3:18 PM Dr. David Alan Gilbert
> > > > <dgilbert at redhat.com> wrote:
> > > > >
> > > > > * Liu Bo (bo.liu at linux.alibaba.com) wrote:
> > > > > > From: Xiaoguang Wang <xiaoguang.wang at 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 at linux.alibaba.com>
> > > > >
> > > > >   We need to check what 'fuse' expects - is it defined what
> > > > > fallocate features it has, and what the semantics are?
> > > >
> > > > The patch looks good to me.
> > > >
> > > > Fuse (the kernel part) supports FALLOC_FL_KEEP_SIZE and
> > > > FALLOC_FL_PUNCH_HOLE, but returns EOPNOTSUPP for any other flag.
> > > >
> > > > Even if, at a later time, fuse starts supporting additional fallocate
> > > > flags, then the passthrough implementation calling fallocate(2) should
> > > > be fine.
> > >
> > > OK, so then I'll take this patch; would it make sense for it to be sent
> > > to upstream fuse?
> > 
> > It would have to be wrapped in #ifdef HAVE_FALLOCATE to make it
> > portable.   Otherwise I don't see why not.
> 
> OK, I'll take it for now.
> 
> Liu Bo: Can you make it portable please and post it upstream on the fuse
> list?
>

No problem, will do it.

thanks,
-liubo




More information about the Virtio-fs mailing list