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

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