yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-virtiofsd-passthrough_ll-add-renameat2-support.patch

ddf19c
From 86b4f2865f2ebd7e6b3d85beb66a9390eb46eb96 Mon Sep 17 00:00:00 2001
ddf19c
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
ddf19c
Date: Mon, 27 Jan 2020 19:01:45 +0100
ddf19c
Subject: [PATCH 074/116] virtiofsd: passthrough_ll: add renameat2 support
ddf19c
MIME-Version: 1.0
ddf19c
Content-Type: text/plain; charset=UTF-8
ddf19c
Content-Transfer-Encoding: 8bit
ddf19c
ddf19c
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
Message-id: <20200127190227.40942-71-dgilbert@redhat.com>
ddf19c
Patchwork-id: 93531
ddf19c
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 070/112] virtiofsd: passthrough_ll: add renameat2 support
ddf19c
Bugzilla: 1694164
ddf19c
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
ddf19c
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
ddf19c
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
ddf19c
ddf19c
From: Miklos Szeredi <mszeredi@redhat.com>
ddf19c
ddf19c
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
ddf19c
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
(cherry picked from commit f0ab7d6f78a7d3c1c19fd81a91c9b1199f56c4f6)
ddf19c
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
ddf19c
---
ddf19c
 tools/virtiofsd/passthrough_ll.c | 10 ++++++++++
ddf19c
 1 file changed, 10 insertions(+)
ddf19c
ddf19c
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
ddf19c
index 98114a3..18d69ab 100644
ddf19c
--- a/tools/virtiofsd/passthrough_ll.c
ddf19c
+++ b/tools/virtiofsd/passthrough_ll.c
ddf19c
@@ -1099,7 +1099,17 @@ static void lo_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
ddf19c
     }
ddf19c
 
ddf19c
     if (flags) {
ddf19c
+#ifndef SYS_renameat2
ddf19c
         fuse_reply_err(req, EINVAL);
ddf19c
+#else
ddf19c
+        res = syscall(SYS_renameat2, lo_fd(req, parent), name,
ddf19c
+                       lo_fd(req, newparent), newname, flags);
ddf19c
+        if (res == -1 && errno == ENOSYS) {
ddf19c
+            fuse_reply_err(req, EINVAL);
ddf19c
+        } else {
ddf19c
+            fuse_reply_err(req, res == -1 ? errno : 0);
ddf19c
+        }
ddf19c
+#endif
ddf19c
         return;
ddf19c
     }
ddf19c
 
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c