]> 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>
Mon, 30 Jan 2023 07:34:57 +0000 (15:34 +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>
src/ceph_fuse.cc

index 115856f381cfd9cbfcd0bf7d8cee99b44677fce9..aae412694038e314069b8ce52ef666f22c8e564e 100644 (file)
@@ -202,10 +202,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");