From c9d9c148887d1ad047c919051415051546422f18 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Tue, 4 May 2010 18:08:48 +0800 Subject: [PATCH] b=22563 Don't assume there is always a request in obd->obd_recovery_queue. i=tappro i=panda --- lustre/ldlm/ldlm_lib.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index f8d53d0..2d2aa6b 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1508,6 +1508,17 @@ static int check_for_next_transno(struct obd_device *obd) } spin_lock_bh(&obd->obd_processing_task_lock); + if (obd->obd_abort_recovery) { + CDEBUG(D_HA, "waking for aborted recovery\n"); + spin_unlock_bh(&obd->obd_processing_task_lock); + return 1; + } else if (!obd->obd_recovering) { + CDEBUG(D_HA, "waking for completed recovery (?)\n"); + spin_unlock_bh(&obd->obd_processing_task_lock); + return 1; + } + + LASSERT(!list_empty(&obd->obd_recovery_queue)); req = list_entry(obd->obd_recovery_queue.next, struct ptlrpc_request, rq_list); max = obd->obd_max_recoverable_clients; @@ -1522,13 +1533,7 @@ static int check_for_next_transno(struct obd_device *obd) "queue_len: %d, req_transno: "LPU64", next_transno: "LPU64"\n", max, connected, obd->obd_delayed_clients, completed, queue_len, req_transno, next_transno); - if (obd->obd_abort_recovery) { - CDEBUG(D_HA, "waking for aborted recovery\n"); - wake_up = 1; - } else if (!obd->obd_recovering) { - CDEBUG(D_HA, "waking for completed recovery (?)\n"); - wake_up = 1; - } else if (req_transno == next_transno) { + if (req_transno == next_transno) { CDEBUG(D_HA, "waking for next ("LPD64")\n", next_transno); wake_up = 1; } else if (queue_len == obd->obd_recoverable_clients) { -- 1.8.3.1