From e701ee7492dbd1103e61304dd457599872c5702c Mon Sep 17 00:00:00 2001 From: tappro Date: Wed, 11 Mar 2009 09:08:25 +0000 Subject: [PATCH] - set correct rq_srv_thread for requests in process_recovery_queue b:18221 i:adilger,rread,johann --- lustre/include/obd.h | 2 ++ lustre/ldlm/ldlm_lib.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 01696e9..241c86d 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -897,6 +897,8 @@ struct obd_device { int obd_recoverable_clients; spinlock_t obd_processing_task_lock; /* BH lock (timer) */ pid_t obd_processing_task; + /* thread to handle recovery queue */ + struct ptlrpc_thread *obd_recovery_thread; __u64 obd_next_recovery_transno; int obd_replayed_requests; int obd_requests_queued_for_recovery; diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index a1ea2a6..f6eea1c 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1369,6 +1369,9 @@ static void process_recovery_queue(struct obd_device *obd) } target_exp_dequeue_req_replay(req); list_del_init(&req->rq_list); + LASSERT(obd->obd_recovery_thread); + /* replace request initial thread with current one, bug #18221 */ + req->rq_svc_thread = obd->obd_recovery_thread; obd->obd_requests_queued_for_recovery--; spin_unlock_bh(&obd->obd_processing_task_lock); @@ -1389,6 +1392,7 @@ static void process_recovery_queue(struct obd_device *obd) obd->obd_next_recovery_transno++; if (list_empty(&obd->obd_recovery_queue)) { obd->obd_processing_task = 0; + obd->obd_recovery_thread = NULL; spin_unlock_bh(&obd->obd_processing_task_lock); break; } @@ -1505,6 +1509,8 @@ int target_queue_recovery_request(struct ptlrpc_request *req, * now, so we'll do the honours. */ obd->obd_processing_task = cfs_curproc_pid(); + /* save thread that handle recovery queue */ + obd->obd_recovery_thread = req->rq_svc_thread; spin_unlock_bh(&obd->obd_processing_task_lock); process_recovery_queue(obd); -- 1.8.3.1