Blame SOURCES/kvm-virtiofsd-use-fuse_lowlevel_is_virtio-in-fuse_sessio.patch

902636
From 1724f54070d33d8070ba2d22c8fac87ea65814c1 Mon Sep 17 00:00:00 2001
902636
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
902636
Date: Mon, 27 Jan 2020 19:02:04 +0100
902636
Subject: [PATCH 093/116] virtiofsd: use fuse_lowlevel_is_virtio() in
902636
 fuse_session_destroy()
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-90-dgilbert@redhat.com>
902636
Patchwork-id: 93540
902636
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 089/112] virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy()
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: Stefan Hajnoczi <stefanha@redhat.com>
902636
902636
vu_socket_path is NULL when --fd=FDNUM was used.  Use
902636
fuse_lowlevel_is_virtio() instead.
902636
902636
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
902636
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
902636
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
(cherry picked from commit 620e9d8d9cee6df7fe71168dea950dba0cc21a4a)
902636
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
902636
---
902636
 tools/virtiofsd/fuse_lowlevel.c | 7 ++++---
902636
 1 file changed, 4 insertions(+), 3 deletions(-)
902636
902636
diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
902636
index 70568d2..dab6a31 100644
902636
--- a/tools/virtiofsd/fuse_lowlevel.c
902636
+++ b/tools/virtiofsd/fuse_lowlevel.c
902636
@@ -2537,12 +2537,13 @@ void fuse_session_destroy(struct fuse_session *se)
902636
         close(se->fd);
902636
     }
902636
 
902636
-    if (se->vu_socket_path) {
902636
+    if (fuse_lowlevel_is_virtio(se)) {
902636
         virtio_session_close(se);
902636
-        free(se->vu_socket_path);
902636
-        se->vu_socket_path = NULL;
902636
     }
902636
 
902636
+    free(se->vu_socket_path);
902636
+    se->vu_socket_path = NULL;
902636
+
902636
     free(se);
902636
 }
902636
 
902636
-- 
902636
1.8.3.1
902636