Blame 0115-virtiofsd-passthrough_ll-Pass-errno-to-fuse_reply_er.patch

1d442b
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
1d442b
Date: Mon, 27 Jan 2020 19:02:24 +0000
1d442b
Subject: [PATCH] virtiofsd/passthrough_ll: Pass errno to fuse_reply_err()
1d442b
1d442b
lo_copy_file_range() passes -errno to fuse_reply_err() and then fuse_reply_err()
1d442b
changes it to errno again, so that subsequent fuse_send_reply_iov_nofree() catches
1d442b
the wrong errno.(i.e. reports "fuse: bad error value: ...").
1d442b
1d442b
Make fuse_send_reply_iov_nofree() accept the correct -errno by passing errno
1d442b
directly in lo_copy_file_range().
1d442b
1d442b
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
1d442b
Reviewed-by: Eryu Guan <eguan@linux.alibaba.com>
1d442b
1d442b
dgilbert: Sent upstream and now Merged as aa1185e153f774f1df65
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
(cherry picked from commit a931b6861e59c78d861017e9c6a9c161ff49a163)
1d442b
---
1d442b
 tools/virtiofsd/passthrough_ll.c | 2 +-
1d442b
 1 file changed, 1 insertion(+), 1 deletion(-)
1d442b
1d442b
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
1d442b
index fc15d61510..e6f2399efc 100644
1d442b
--- a/tools/virtiofsd/passthrough_ll.c
1d442b
+++ b/tools/virtiofsd/passthrough_ll.c
1d442b
@@ -2441,7 +2441,7 @@ static void lo_copy_file_range(fuse_req_t req, fuse_ino_t ino_in, off_t off_in,
1d442b
 
1d442b
     res = copy_file_range(in_fd, &off_in, out_fd, &off_out, len, flags);
1d442b
     if (res < 0) {
1d442b
-        fuse_reply_err(req, -errno);
1d442b
+        fuse_reply_err(req, errno);
1d442b
     } else {
1d442b
         fuse_reply_write(req, res);
1d442b
     }