Whamcloud - gitweb
b=6398
authoralex <alex>
Thu, 26 May 2005 11:08:39 +0000 (11:08 +0000)
committeralex <alex>
Thu, 26 May 2005 11:08:39 +0000 (11:08 +0000)
 - 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

index e94e216..fa6e647 100644 (file)
@@ -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;