From 3f008e12722c710e7f539b4e763fff506e26e495 Mon Sep 17 00:00:00 2001 From: lizhipeng Date: Wed, 2 Jul 2025 14:57:18 +0800 Subject: [PATCH] fix ceph-fuse mounting fail and coredump Signed-off-by: lizhipeng (cherry picked from commit 5d107d8d94cb20d93216074458bed0561d50d44b) --- ...ent-set-LIBMOUNT_FORCE_MOUNT2-always.patch | 34 +++++++++++++++++++ ceph.spec | 6 +++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 0007-client-set-LIBMOUNT_FORCE_MOUNT2-always.patch diff --git a/0007-client-set-LIBMOUNT_FORCE_MOUNT2-always.patch b/0007-client-set-LIBMOUNT_FORCE_MOUNT2-always.patch new file mode 100644 index 0000000..f4fd404 --- /dev/null +++ b/0007-client-set-LIBMOUNT_FORCE_MOUNT2-always.patch @@ -0,0 +1,34 @@ +From 9ca1d4be2b587ce1d3e6c10dc2a98195b2ab3ba9 Mon Sep 17 00:00:00 2001 +From: Jakob Haufe +Date: Tue, 30 Apr 2024 17:45:24 +0200 +Subject: [PATCH] client: set LIBMOUNT_FORCE_MOUNT2=always + +This is a workaround for libmount 2.38 or later on linux kernel 5.1 or +later. + +libmount defaults to the new fsconfig interface which does not support +remounting the way the old mount(2) syscall did. Thus, dentry trimming +fails. + +Fixes: https://tracker.ceph.com/issues/62664 +Signed-off-by: Jakob Haufe +--- + src/client/fuse_ll.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc +index 0e2e200644d..67f8d8ea768 100644 +--- a/src/client/fuse_ll.cc ++++ b/src/client/fuse_ll.cc +@@ -1266,7 +1266,7 @@ static int remount_cb(void *handle) + // trims all unused dentries in the file system + char cmd[128+PATH_MAX]; + CephFuse::Handle *cfuse = (CephFuse::Handle *)handle; +- snprintf(cmd, sizeof(cmd), "LIBMOUNT_FSTAB=/dev/null mount -i -o remount %s", ++ snprintf(cmd, sizeof(cmd), "LIBMOUNT_FSTAB=/dev/null LIBMOUNT_FORCE_MOUNT2=always mount -i -o remount %s", + #if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0) + cfuse->opts.mountpoint); + #else +-- +2.47.1 + diff --git a/ceph.spec b/ceph.spec index 3b6b3b6..04e0533 100644 --- a/ceph.spec +++ b/ceph.spec @@ -174,7 +174,7 @@ ################################################################################# Name: ceph Version: 18.2.2 -Release: 7 +Release: 8 %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} Epoch: 2 %endif @@ -198,6 +198,7 @@ Patch3: 0003-fix-CVE-2023-46159.patch Patch4: 0004-fix-mds-metadata-lost-in-one-case.patch Patch6: 0005-fix-lz4-not-found.patch Patch7: 0006-fix-CVE-2024-48916.patch +Patch8: 0007-client-set-LIBMOUNT_FORCE_MOUNT2-always.patch %ifarch loongarch64 Patch5: 9001-add-supprot-for-loongarch64.patch @@ -2644,6 +2645,9 @@ exit 0 %{_datadir}/snmp/mibs %changelog +* Wed Jul 2 2025 lizhipeng - 2:18.2.2-8 +- fix ceph-fuse mounting fail and coredump + * Sat Dec 28 2024 wangzengliang - 2:18.2.2-7 - fix CVE-2024-48916 -- Gitee