Whamcloud - gitweb
* Moved the CDEBUG message in the exit path of log_commit_thread. It was
authoreeb <eeb>
Tue, 7 Dec 2004 14:11:39 +0000 (14:11 +0000)
committereeb <eeb>
Tue, 7 Dec 2004 14:11:39 +0000 (14:11 +0000)
    possible for portals_debug_msg() to crash dereferencing the format
    string if the CDEBUG happened after the thread had signalled that it
    was about to exit.  I guess the data segment got unloaded before the
    log_commit_thread had exited!

lustre/ptlrpc/recov_thread.c

index b806b1e..11d94e8 100644 (file)
@@ -425,12 +425,13 @@ static int log_commit_thread(void *arg)
         spin_unlock(&lcm->lcm_thread_lock);
         OBD_FREE(lcd, sizeof(*lcd));
 
+        CDEBUG(D_HA, "%s exiting\n", current->comm);
+
         spin_lock(&lcm->lcm_thread_lock);
         atomic_dec(&lcm->lcm_thread_total);
         spin_unlock(&lcm->lcm_thread_lock);
         wake_up(&lcm->lcm_waitq);
 
-        CDEBUG(D_HA, "%s exiting\n", current->comm);
         return 0;
 }