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)
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
#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
#include "include/ceph_fuse.h"
#include "fuse_ll.h"
-#include <fuse.h>
#include <fuse_lowlevel.h>
#define dout_context g_ceph_context
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);
*
*/
-#define FUSE_USE_VERSION 30
-
class CephFuse {
public:
CephFuse(Client *c, int fd);
#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"
// 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>
/*
* rbd-fuse
*/
-#define FUSE_USE_VERSION 30
-
#include "include/int_types.h"
#include <stdio.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <fuse.h>
#include <pthread.h>
#include <string.h>
#include <sys/types.h>