From 9877223c3117e88c16a9281cc8ca7dc1951495ea Mon Sep 17 00:00:00 2001 From: tappro Date: Wed, 11 Mar 2009 09:04:38 +0000 Subject: [PATCH] - set correct thread in rq_srv_thread for requests processing in process_recovery_queue() b:18221 i:adilger,rread,johann --- lustre/include/obd.h | 2 ++ lustre/ldlm/ldlm_lib.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 4741683..55a5799 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -951,6 +951,8 @@ struct obd_device { int obd_delayed_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 7b29378..36e5032 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1128,6 +1128,7 @@ static void target_finish_recovery(struct obd_device *obd) ldlm_reprocess_all_ns(obd->obd_namespace); spin_lock_bh(&obd->obd_processing_task_lock); if (list_empty(&obd->obd_recovery_queue)) { + obd->obd_recovery_thread = NULL; obd->obd_processing_task = 0; } else { spin_unlock_bh(&obd->obd_processing_task_lock); @@ -1453,6 +1454,9 @@ static void process_recovery_queue(struct obd_device *obd) continue; } 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); @@ -1477,6 +1481,7 @@ static void process_recovery_queue(struct obd_device *obd) spin_lock_bh(&obd->obd_processing_task_lock); 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; } @@ -1593,6 +1598,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