Whamcloud - gitweb
- set correct thread in rq_srv_thread for requests processing in
authortappro <tappro>
Wed, 11 Mar 2009 09:04:38 +0000 (09:04 +0000)
committertappro <tappro>
Wed, 11 Mar 2009 09:04:38 +0000 (09:04 +0000)
  process_recovery_queue()
b:18221
i:adilger,rread,johann

lustre/include/obd.h
lustre/ldlm/ldlm_lib.c

index 4741683..55a5799 100644 (file)
@@ -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;
index 7b29378..36e5032 100644 (file)
@@ -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);