thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
ddf19c
From 8e6473e906dfc7d2a62abaf1ec80ff461e4d201d Mon Sep 17 00:00:00 2001
ddf19c
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
ddf19c
Date: Mon, 27 Jan 2020 19:02:12 +0100
ddf19c
Subject: [PATCH 101/116] virtiofsd: do not always set FUSE_FLOCK_LOCKS
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-98-dgilbert@redhat.com>
ddf19c
Patchwork-id: 93551
ddf19c
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 097/112] virtiofsd: do not always set FUSE_FLOCK_LOCKS
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: Peng Tao <tao.peng@linux.alibaba.com>
ddf19c
ddf19c
Right now we always enable it regardless of given commandlines.
ddf19c
Fix it by setting the flag relying on the lo->flock bit.
ddf19c
ddf19c
Signed-off-by: Peng Tao <tao.peng@linux.alibaba.com>
ddf19c
Reviewed-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
ddf19c
Reviewed-by: Sergio Lopez <slp@redhat.com>
ddf19c
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
(cherry picked from commit e468d4af5f5192ab33283464a9f6933044ce47f7)
ddf19c
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
ddf19c
---
ddf19c
 tools/virtiofsd/passthrough_ll.c | 11 ++++++++---
ddf19c
 1 file changed, 8 insertions(+), 3 deletions(-)
ddf19c
ddf19c
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
ddf19c
index ab16135..ccbbec1 100644
ddf19c
--- a/tools/virtiofsd/passthrough_ll.c
ddf19c
+++ b/tools/virtiofsd/passthrough_ll.c
ddf19c
@@ -546,9 +546,14 @@ static void lo_init(void *userdata, struct fuse_conn_info *conn)
ddf19c
         fuse_log(FUSE_LOG_DEBUG, "lo_init: activating writeback\n");
ddf19c
         conn->want |= FUSE_CAP_WRITEBACK_CACHE;
ddf19c
     }
ddf19c
-    if (lo->flock && conn->capable & FUSE_CAP_FLOCK_LOCKS) {
ddf19c
-        fuse_log(FUSE_LOG_DEBUG, "lo_init: activating flock locks\n");
ddf19c
-        conn->want |= FUSE_CAP_FLOCK_LOCKS;
ddf19c
+    if (conn->capable & FUSE_CAP_FLOCK_LOCKS) {
ddf19c
+        if (lo->flock) {
ddf19c
+            fuse_log(FUSE_LOG_DEBUG, "lo_init: activating flock locks\n");
ddf19c
+            conn->want |= FUSE_CAP_FLOCK_LOCKS;
ddf19c
+        } else {
ddf19c
+            fuse_log(FUSE_LOG_DEBUG, "lo_init: disabling flock locks\n");
ddf19c
+            conn->want &= ~FUSE_CAP_FLOCK_LOCKS;
ddf19c
+        }
ddf19c
     }
ddf19c
 
ddf19c
     if (conn->capable & FUSE_CAP_POSIX_LOCKS) {
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c