Re: [Virtio-fs] [PATCH 1/2] vitriofsd/passthrough_ll: Make fallocate() work
* Xiao Yang (yangx...@cn.fujitsu.com) wrote: > On 2020/1/14 20:14, Dr. David Alan Gilbert 写wrote: > > 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. > Hi Dave, > > Thanks for your review and explanation. > Do you mean that I don't need to send v2 patch? Correct; I've merged together the patches you sent. I'll push a new -dev just as soon as I've done a basic smoke test. Dave > Thanks, > Xiao Yang > > > > Dave > > > -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK ___ Virtio-fs mailing list Virtio-fs@redhat.com https://www.redhat.com/mailman/listinfo/virtio-fs
Re: [Virtio-fs] [PATCH 1/2] vitriofsd/passthrough_ll: Make fallocate() work
On 2020/1/14 20:14, Dr. David Alan Gilbert 写wrote: 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. Hi Dave, Thanks for your review and explanation. Do you mean that I don't need to send v2 patch? Thanks, Xiao Yang Dave ___ Virtio-fs mailing list Virtio-fs@redhat.com https://www.redhat.com/mailman/listinfo/virtio-fs
Re: [Virtio-fs] [PATCH 1/2] vitriofsd/passthrough_ll: Make fallocate() work
* Xiao Yang (yangx...@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 > --- > 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 / dgilb...@redhat.com / Manchester, UK ___ Virtio-fs mailing list Virtio-fs@redhat.com https://www.redhat.com/mailman/listinfo/virtio-fs
[Virtio-fs] [PATCH 1/2] vitriofsd/passthrough_ll: Make fallocate() work
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 --- 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); if (err < 0) { err = errno; } -- 2.21.0 ___ Virtio-fs mailing list Virtio-fs@redhat.com https://www.redhat.com/mailman/listinfo/virtio-fs