From 2c215cb2cbe5c38e8719ff42680cc907cc7e4284 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 26 May 2005 11:08:39 +0000 Subject: [PATCH] b=6398 - target_start_recovery_thread() starts a thread and must wait for completion because that thread sets recovering flag. but routine kernel_thread() returns pid > 0 in successful case, while the target_start_recover_thread() expects 0. so, first routine target_start_recovery_thread() returns immediately and chain mds_postsetup() -> mds_dt_connect() is called with obd_recovering==0. so, mds_postrecov_common() is called and it calls mds_cleanup_orphans() --- lustre/ldlm/ldlm_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index e94e216..fa6e647 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1401,7 +1401,7 @@ int target_start_recovery_thread(struct obd_device *obd, svc_handler_t handler) init_completion(&trd->trd_finishing); trd->trd_recovery_handler = handler; - if (kernel_thread(target_recovery_thread, obd, 0) == 0) + if (kernel_thread(target_recovery_thread, obd, 0) > 0) wait_for_completion(&trd->trd_starting); else rc = -ECHILD; -- 1.8.3.1