]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fuse: update to newer FUSE_USE_VERSION 35450/head
authorJeff Layton <jlayton@redhat.com>
Wed, 3 Jun 2020 15:29:07 +0000 (11:29 -0400)
committerNathan Cutler <ncutler@suse.com>
Thu, 18 Jun 2020 21:06:47 +0000 (23:06 +0200)
The build was failing for me against fuse-devel v3.9.1. The prototype
for fuse_ll_ioctl was wrong, as it was expecting the old-style one with
signed int args.

In newer libfuse versions, the prototype varies based on
FUSE_USE_VERSION. Update to a newer FUSE_USE_VERSION value to ensure
that we use the newer ioctl prototype. This also means that we need to
handle a new prototype for fuse_session_loop_mt as well.

While we're in here, move the definition of FUSE_USE_VERSION to
ceph_fuse.h so we have the definition in one place. This does mean we
need to reorganize the includes in a few places.

Fixes: https://tracker.ceph.com/issues/45866
Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit cfbc0fb48a9880dabe8f332e9bf67d81867ae198)

fusetrace/fusetrace_ll.cc
src/ceph_fuse.cc
src/client/fuse_ll.cc
src/client/fuse_ll.h
src/include/ceph_fuse.h
src/os/FuseStore.cc
src/rbd_fuse/rbd-fuse.cc

index b411a83fe20381b04ba5f012d01e73a02064f705..f10c29fd22e9ef1806e47541deae9319b6753f92 100644 (file)
@@ -11,8 +11,6 @@
     gcc -Wall `pkg-config fuse --cflags --libs` -lulockmgr fusexmp_fh.c -o fusexmp_fh
 */
 
-#define FUSE_USE_VERSION 30
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
index 2f8e3e4a41118a7d4477e6100b8b1145f88106f7..b707806b6699ec267800cb0b6ac469dc569681a5 100644 (file)
@@ -40,9 +40,8 @@
 #include <sys/types.h>
 #include <fcntl.h>
 
-#include <fuse.h>
-#include <fuse_lowlevel.h>
 #include "include/ceph_fuse.h"
+#include <fuse_lowlevel.h>
 
 #define dout_context g_ceph_context
 
index 2eec01d583f59fcd8faaeb8114ee76b7c96b7113..82e979ffebfb11d9786417c14cd87e1663a2d613 100644 (file)
@@ -37,7 +37,6 @@
 #include "include/ceph_fuse.h"
 
 #include "fuse_ll.h"
-#include <fuse.h>
 #include <fuse_lowlevel.h>
 
 #define dout_context g_ceph_context
@@ -1263,7 +1262,14 @@ int CephFuse::Handle::loop()
   auto fuse_multithreaded = client->cct->_conf.get_val<bool>(
     "fuse_multithreaded");
   if (fuse_multithreaded) {
-#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
+#if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 1)
+    {
+      struct fuse_loop_config conf = { 0 };
+
+      conf.clone_fd = opts.clone_fd;
+      return fuse_session_loop_mt(se, &conf);
+    }
+#elif FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
     return fuse_session_loop_mt(se, opts.clone_fd);
 #else
     return fuse_session_loop_mt(se);
index 3d7b891ddb44a1a48de71585d0450219954c315f..85e587baf46b55acac1de0cf5c06995ebc4e8f50 100644 (file)
@@ -12,8 +12,6 @@
  * 
  */
 
-#define FUSE_USE_VERSION 30
-
 class CephFuse {
 public:
   CephFuse(Client *c, int fd);
index ae504f6715de476f56b8166f0f243ade7132b3e1..c95fd19408c257b84d04978455a16ac7fbe3d973 100644 (file)
 #ifndef CEPH_FUSE_H
 #define CEPH_FUSE_H
 
-#define FUSE_USE_VERSION 30
+/*
+ * The API version that we want to use, regardless of what the
+ * library version is. Note that this must be defined before
+ * fuse.h is included.
+ */
+#ifndef FUSE_USE_VERSION
+#define FUSE_USE_VERSION       35
+#endif
+
 #include <fuse.h>
 #include "acconfig.h"
 
index 80b5f9aaa01b04af14086f1dc02f12a03fe30f83..54200f1d006f3009d770b5227fedd63b6c41f537 100644 (file)
@@ -2,15 +2,13 @@
 // vim: ts=8 sw=2 smarttab
 
 #include "include/compat.h"
+#include "include/ceph_fuse.h"
 #include "FuseStore.h"
 #include "os/ObjectStore.h"
 #include "include/stringify.h"
 #include "common/errno.h"
 
-#define FUSE_USE_VERSION 30
-#include <fuse.h>
 #include <fuse_lowlevel.h>
-#include "include/ceph_fuse.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
index e7c8166542a7dd849711c17f7ee959c4ac6ec0b2..6d6db311929c5899b40df42de9ae365b671dab5a 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * rbd-fuse
  */
-#define FUSE_USE_VERSION 30
-
 #include "include/int_types.h"
 
 #include <stdio.h>
@@ -11,7 +9,6 @@
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <fuse.h>
 #include <pthread.h>
 #include <string.h>
 #include <sys/types.h>