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 <sur5r@sur5r.net>
// 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