yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-virtiofsd-passthrough_ll-Pass-errno-to-fuse_reply_er.patch

22c213
From fe031dbbf5e287f64de9fcc9aec361e8ab492109 Mon Sep 17 00:00:00 2001
22c213
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
22c213
Date: Mon, 27 Jan 2020 19:02:24 +0100
22c213
Subject: [PATCH 113/116] virtiofsd/passthrough_ll: Pass errno to
22c213
 fuse_reply_err()
22c213
MIME-Version: 1.0
22c213
Content-Type: text/plain; charset=UTF-8
22c213
Content-Transfer-Encoding: 8bit
22c213
22c213
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
22c213
Message-id: <20200127190227.40942-110-dgilbert@redhat.com>
22c213
Patchwork-id: 93559
22c213
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 109/112] virtiofsd/passthrough_ll: Pass errno to fuse_reply_err()
22c213
Bugzilla: 1694164
22c213
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
22c213
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
22c213
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
22c213
22c213
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
22c213
22c213
lo_copy_file_range() passes -errno to fuse_reply_err() and then fuse_reply_err()
22c213
changes it to errno again, so that subsequent fuse_send_reply_iov_nofree() catches
22c213
the wrong errno.(i.e. reports "fuse: bad error value: ...").
22c213
22c213
Make fuse_send_reply_iov_nofree() accept the correct -errno by passing errno
22c213
directly in lo_copy_file_range().
22c213
22c213
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
22c213
Reviewed-by: Eryu Guan <eguan@linux.alibaba.com>
22c213
22c213
dgilbert: Sent upstream and now Merged as aa1185e153f774f1df65
22c213
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
22c213
(cherry picked from commit a931b6861e59c78d861017e9c6a9c161ff49a163)
22c213
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
22c213
---
22c213
 tools/virtiofsd/passthrough_ll.c | 2 +-
22c213
 1 file changed, 1 insertion(+), 1 deletion(-)
22c213
22c213
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
22c213
index fc15d61..e6f2399 100644
22c213
--- a/tools/virtiofsd/passthrough_ll.c
22c213
+++ b/tools/virtiofsd/passthrough_ll.c
22c213
@@ -2441,7 +2441,7 @@ static void lo_copy_file_range(fuse_req_t req, fuse_ino_t ino_in, off_t off_in,
22c213
 
22c213
     res = copy_file_range(in_fd, &off_in, out_fd, &off_out, len, flags);
22c213
     if (res < 0) {
22c213
-        fuse_reply_err(req, -errno);
22c213
+        fuse_reply_err(req, errno);
22c213
     } else {
22c213
         fuse_reply_write(req, res);
22c213
     }
22c213
-- 
22c213
1.8.3.1
22c213