From: hongchao.zhang Date: Sun, 28 Feb 2010 23:30:04 +0000 (+0800) Subject: b=21726 stop waitting for next replay transno if shutdown X-Git-Tag: v1_8_2_52~26 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2a038f7a09b86efe46773b2f52fc193fd10ae216;p=fs%2Flustre-release.git b=21726 stop waitting for next replay transno if shutdown 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 --- diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 16efa09..96d2bb4 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -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);