From: Xiubo Li Date: Fri, 15 Jul 2022 09:41:43 +0000 (+0800) Subject: ceph_fuse: retry the test_dentry_handling if fails X-Git-Tag: v16.2.12~3^2~53^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=bf7839b4cb5aa3ae1ad07b7112ce03010a02c22d;p=ceph.git ceph_fuse: retry the test_dentry_handling if fails 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 (cherry picked from commit f6a9bd6a69362527502eba4906e2605f3474007f) --- diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index de668541b1f3d..e2d384a787bc4 100644 --- a/src/ceph_fuse.cc +++ b/src/ceph_fuse.cc @@ -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( "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( + "client_max_retries_on_remount_failure"); + std::pair 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( "client_die_on_failed_dentry_invalidate");