]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_fuse: retry the test_dentry_handling if fails
authorXiubo Li <xiubli@redhat.com>
Fri, 15 Jul 2022 09:41:43 +0000 (17:41 +0800)
committerXiubo Li <xiubli@redhat.com>
Fri, 10 Mar 2023 05:49:39 +0000 (13:49 +0800)
For some unknown reason the remount will fail, we need to retry it
for the test_dentry_handling.

Fixes: https://tracker.ceph.com/issues/56532
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit f6a9bd6a69362527502eba4906e2605f3474007f)

src/ceph_fuse.cc

index de668541b1f3d1be4b22112272243f4bba55de70..e2d384a787bc4ab3dab3d504e4837b2aaffac78c 100644 (file)
@@ -201,10 +201,21 @@ int main(int argc, const char **argv, const char *envp[]) {
        ceph_assert(ver != 0);
         bool client_try_dentry_invalidate = g_conf().get_val<bool>(
           "client_try_dentry_invalidate");
-       bool can_invalidate_dentries =
+        bool can_invalidate_dentries =
           client_try_dentry_invalidate && ver < KERNEL_VERSION(3, 18, 0);
-       auto test_result = client->test_dentry_handling(can_invalidate_dentries);
-       int tr = test_result.first;
+        uint64_t max_retries = g_conf().get_val<uint64_t>(
+          "client_max_retries_on_remount_failure");
+        std::pair<int, bool> test_result;
+        uint64_t i = 0;
+        int tr = 0;
+        do {
+          test_result = client->test_dentry_handling(can_invalidate_dentries);
+          tr = test_result.first;
+          if (tr) {
+            sleep(1);
+          }
+        } while (++i < max_retries && tr);
+
        bool abort_on_failure = test_result.second;
         bool client_die_on_failed_dentry_invalidate = g_conf().get_val<bool>(
           "client_die_on_failed_dentry_invalidate");