[Virtio-fs] [PATCH] virtiofsd/passthrough_ll: Pass errno to fuse_reply_err()

Eryu Guan eguan at linux.alibaba.com
Thu Jan 2 04:50:35 UTC 2020


On Thu, Jan 02, 2020 at 11:53:12AM +0800, Xiao Yang wrote:
> lo_copy_file_range() passes -errno to fuse_reply_err() and then fuse_reply_err()
> changes it to errno again, so that subsequent fuse_send_reply_iov_nofree() catches
> the wrong errno.(i.e. reports "fuse: bad error value: ...").
> 
> Make fuse_send_reply_iov_nofree() accept the correct -errno by passing errno
> directly in lo_copy_file_range().
> 
> Signed-off-by: Xiao Yang <yangx.jy at cn.fujitsu.com>

Looks good to me.

Reviewed-by: Eryu Guan <eguan at linux.alibaba.com>

I also went through the other fuse_reply_err() calls and they all pass
positive error number to the second arg.

Thanks,
Eryu

> ---
>  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 83dd0084b4..a77bed655e 100644
> --- a/tools/virtiofsd/passthrough_ll.c
> +++ b/tools/virtiofsd/passthrough_ll.c
> @@ -2615,7 +2615,7 @@ static void lo_copy_file_range(fuse_req_t req, fuse_ino_t ino_in, off_t off_in,
>  
>      res = copy_file_range(in_fd, &off_in, out_fd, &off_out, len, flags);
>      if (res < 0) {
> -        fuse_reply_err(req, -errno);
> +        fuse_reply_err(req, errno);
>      } else {
>          fuse_reply_write(req, res);
>      }
> -- 
> 2.21.0
> 
> 
> 
> 
> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs at redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs





More information about the Virtio-fs mailing list