]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: switch to old method to invalidate dcache if euid != 0
authorXiubo Li <xiubli@redhat.com>
Thu, 20 Oct 2022 04:16:55 +0000 (12:16 +0800)
committerXiubo Li <xiubli@redhat.com>
Mon, 30 Jan 2023 07:34:57 +0000 (15:34 +0800)
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 <xiubli@redhat.com>
src/client/Client.cc

index 428fe83526a747031a1d1c185f142e2dccdb31d6..a7211d5af7ed87afcffc6c4e18e9712d7dda8769 100644 (file)
@@ -11705,6 +11705,17 @@ std::pair<int, bool> 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;