From 384eda6586ad3481643f82c6d9e51f3cd38b0789 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Thu, 20 Oct 2022 12:16:55 +0800 Subject: [PATCH] client: switch to old method to invalidate dcache if euid != 0 Force to use the old and slow method to invalidate the dcache if the euid is non-root, or the remount may fail with return code 1 or 32. https://tracker.ceph.com/issues/56532 Signed-off-by: Xiubo Li (cherry picked from commit b9b25a54414b60f5da841f3d16b2e267b670ec5b) --- src/client/Client.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index 3139dc96227ca..abb90b006e976 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -11624,6 +11624,17 @@ std::pair Client::test_dentry_handling(bool can_invalidate) can_invalidate_dentries = can_invalidate; + /* + * Force to use the old and slow method to invalidate the dcache + * if the euid is non-root, or the remount may fail with return + * code 1 or 32. + */ + uid_t euid = geteuid(); + ldout(cct, 10) << "euid: " << euid << dendl; + if (euid != 0) { + can_invalidate_dentries = true; + } + if (can_invalidate_dentries) { ceph_assert(dentry_invalidate_cb); ldout(cct, 1) << "using dentry_invalidate_cb" << dendl; -- 2.39.5