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>
(cherry picked from commit
b9b25a54414b60f5da841f3d16b2e267b670ec5b)
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;