From: adilger Date: Thu, 5 Jan 2006 09:58:33 +0000 (+0000) Subject: Branch b_release_1_4_6 X-Git-Tag: v1_7_100~1^103~4^2~119 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=6cf4d667e8607a8a38b503463c40e9d503b5cf6a;p=fs%2Flustre-release.git Branch b_release_1_4_6 Don't update thread->t_id as we exit from ptlrpc_main() after waking t_ctl_waitq, as it is possible the thread struct is being freed by ptlrpc_stop_thread() that was waiting on t_ctl_waitq. r=alex --- diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 7d5a65a..d2aaf5d 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -923,17 +923,16 @@ out_srv_init: svc->srv_done(thread); out: - spin_lock_irqsave(&svc->srv_lock, flags); + CDEBUG(D_NET, "service thread %d exiting: rc %d\n", thread->t_id, rc); + spin_lock_irqsave(&svc->srv_lock, flags); svc->srv_nthreads--; /* must know immediately */ + thread->t_id = rc; thread->t_flags = SVC_STOPPED; - wake_up(&thread->t_ctl_waitq); + wake_up(&thread->t_ctl_waitq); spin_unlock_irqrestore(&svc->srv_lock, flags); - CDEBUG(D_NET, "service thread %d exiting: rc %d\n", thread->t_id, rc); - thread->t_id = rc; - return rc; }