From eab6e38db6a45d6d69ead9f7237e3951f2307faf Mon Sep 17 00:00:00 2001 From: lizhipeng Date: Sun, 6 Jul 2025 23:21:37 +0800 Subject: [PATCH] fix ceph-fuse mounting fail and coredump Signed-off-by: lizhipeng --- ...ent-set-LIBMOUNT_FORCE_MOUNT2-always.patch | 34 +++++++++++++++++++ ceph.spec | 6 +++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 0006-client-set-LIBMOUNT_FORCE_MOUNT2-always.patch diff --git a/0006-client-set-LIBMOUNT_FORCE_MOUNT2-always.patch b/0006-client-set-LIBMOUNT_FORCE_MOUNT2-always.patch new file mode 100644 index 0000000..f4fd404 --- /dev/null +++ b/0006-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 6199c1b..3ce5faa 100644 --- a/ceph.spec +++ b/ceph.spec @@ -174,7 +174,7 @@ ################################################################################# Name: ceph Version: 18.2.2 -Release: 6 +Release: 7 %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} Epoch: 2 %endif @@ -197,6 +197,7 @@ Patch2: 0002-fix-compilation-with-cython3.patch Patch3: 0003-fix-CVE-2023-46159.patch Patch4: 0004-fix-mds-metadata-lost-in-one-case.patch Patch5: 0005-fix-CVE-2024-48916.patch +Patch6: 0006-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-7 +- fix ceph-fuse mounting fail and coredump + * Fri Feb 21 2025 wangzengliang - 2:18.2.2-6 - fix-CVE-2024-48916 -- Gitee