From: Xiubo Li Date: Thu, 20 Oct 2022 04:16:55 +0000 (+0800) Subject: client: switch to old method to invalidate dcache if euid != 0 X-Git-Tag: v18.1.0~431^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b9b25a54414b60f5da841f3d16b2e267b670ec5b;p=ceph-ci.git 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 428fe83526a..a7211d5af7e 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -11705,6 +11705,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;