diff options
author | Xiubo Li <xiubli@redhat.com> | 2020-05-06 02:43:12 +0200 |
---|---|---|
committer | Xiubo Li <xiubli@redhat.com> | 2020-05-25 03:39:47 +0200 |
commit | 7a3cc61de03075ada0527f77b64d3456cb47e3a2 (patch) | |
tree | 708fa4023f9d0cfa1e82c716656f54429c737f20 /src | |
parent | Merge pull request #34174 from theanalyst/doc/active-releases-oct (diff) | |
download | ceph-7a3cc61de03075ada0527f77b64d3456cb47e3a2.tar.xz ceph-7a3cc61de03075ada0527f77b64d3456cb47e3a2.zip |
libfuse: check the libfuse version from the pkconfig/fuse{3}.pc file
Since libfuse 3.2 to 3.8 the minor version for FUSE library has
stopped updating together with the releases. So we cannot check
version by using the FUSE_VERSION macro in the fuse_common.h header
file directly.
This will check the major/minor version from the fuse{3}.pc pkconfig
file.
Fixes: https://tracker.ceph.com/issues/45396
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/ceph_fuse.cc | 1 | ||||
-rw-r--r-- | src/client/fuse_ll.cc | 1 | ||||
-rw-r--r-- | src/include/ceph_fuse.h | 13 | ||||
-rw-r--r-- | src/include/config-h.in.cmake | 6 |
4 files changed, 20 insertions, 1 deletions
diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index 3692b5c6ff6..02aed32ac69 100644 --- a/src/ceph_fuse.cc +++ b/src/ceph_fuse.cc @@ -44,6 +44,7 @@ #include <fuse.h> #include <fuse_lowlevel.h> +#include "include/ceph_fuse.h" #define dout_context g_ceph_context diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index 43b33e32a06..034977b1832 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -34,6 +34,7 @@ #include "common/config.h" #include "include/ceph_assert.h" #include "include/cephfs/ceph_ll_client.h" +#include "include/ceph_fuse.h" #include "fuse_ll.h" #include <fuse.h> diff --git a/src/include/ceph_fuse.h b/src/include/ceph_fuse.h index 45881930b87..ae504f6715d 100644 --- a/src/include/ceph_fuse.h +++ b/src/include/ceph_fuse.h @@ -15,8 +15,19 @@ #define CEPH_FUSE_H #define FUSE_USE_VERSION 30 -#include "acconfig.h" #include <fuse.h> +#include "acconfig.h" + +/* + * Redefine the FUSE_VERSION macro defined in "fuse_common.h" + * header file, because the MINOR numner has been forgotten to + * update since libfuse 3.2 to 3.8. We need to fetch the MINOR + * number from pkgconfig file. + */ +#ifdef FUSE_VERSION +#undef FUSE_VERSION +#define FUSE_VERSION FUSE_MAKE_VERSION(CEPH_FUSE_MAJOR_VERSION, CEPH_FUSE_MINOR_VERSION) +#endif static inline int filler_compat(fuse_fill_dir_t filler, void *buf, const char *name, diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake index e26671d3a00..40cbc430730 100644 --- a/src/include/config-h.in.cmake +++ b/src/include/config-h.in.cmake @@ -87,6 +87,12 @@ /* Define if you have fuse */ #cmakedefine HAVE_LIBFUSE +/* Define version major */ +#define CEPH_FUSE_MAJOR_VERSION @FUSE_MAJOR_VERSION@ + +/* Define version minor */ +#define CEPH_FUSE_MINOR_VERSION @FUSE_MINOR_VERSION@ + /* Define to 1 if you have libxfs */ #cmakedefine HAVE_LIBXFS 1 |