Whamcloud - gitweb
b=21726 stop waitting for next replay transno if shutdown
authorhongchao.zhang <Hongchao.Zhang@Sun.COM>
Sun, 28 Feb 2010 23:30:04 +0000 (07:30 +0800)
committerJohann Lombardi <johann@sun.com>
Thu, 4 Mar 2010 13:01:54 +0000 (14:01 +0100)
if the system is shutting down, wake up service thread blocked
to wait for next replay transno during recovery, then all the
references held by queued requests can be dropped and device
can be stopped.

i=hongchao.zhang@sun.com
i=tappro@sun.com

lustre/ldlm/ldlm_lib.c

index 16efa09..96d2bb4 100644 (file)
@@ -588,6 +588,9 @@ int target_recovery_check_and_stop(struct obd_device *obd)
 {
         int abort_recovery = 0;
 
+        if (obd->obd_stopping)
+                return 1;
+
         spin_lock_bh(&obd->obd_processing_task_lock);
         abort_recovery = obd->obd_abort_recovery;
         obd->obd_abort_recovery = 0;
@@ -1273,6 +1276,7 @@ void target_cleanup_recovery(struct obd_device *obd)
         CFS_INIT_LIST_HEAD(&clean_list);
         spin_lock_bh(&obd->obd_processing_task_lock);
         list_splice_init(&obd->obd_recovery_queue, &clean_list);
+        cfs_waitq_signal(&obd->obd_next_transno_waitq);
         spin_unlock_bh(&obd->obd_processing_task_lock);
         list_for_each_safe(tmp, n, &clean_list) {
                 req = list_entry(tmp, struct ptlrpc_request, rq_list);
@@ -1462,6 +1466,11 @@ static int check_for_next_transno(struct obd_device *obd)
         int wake_up = 0, connected, completed, queue_len, max;
         __u64 next_transno, req_transno;
 
+        if (obd->obd_stopping) {
+                CDEBUG(D_HA, "waking for stooping device\n");
+                return 1;
+        }
+
         spin_lock_bh(&obd->obd_processing_task_lock);
         req = list_entry(obd->obd_recovery_queue.next,
                          struct ptlrpc_request, rq_list);