From: pschwan Date: Wed, 1 May 2002 17:10:59 +0000 (+0000) Subject: Fixed recovd deadlock X-Git-Tag: 0.4.2~300 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=a669544658c116cee3acc362890f5c5df0f4b934;p=fs%2Flustre-release.git Fixed recovd deadlock --- diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 97ecc29..e3386ecf 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -235,7 +235,6 @@ void ptlrpc_resend_req(struct ptlrpc_request *req) req->rq_flags &= ~PTL_RPC_FL_TIMEOUT; wake_up_interruptible(&req->rq_wait_for_rep); EXIT; - return; } int ptl_send_rpc(struct ptlrpc_request *request) diff --git a/lustre/ptlrpc/recovd.c b/lustre/ptlrpc/recovd.c index 9547816..7e8e9c4 100644 --- a/lustre/ptlrpc/recovd.c +++ b/lustre/ptlrpc/recovd.c @@ -108,7 +108,6 @@ static int recovd_check_event(struct recovd_obd *recovd) static int recovd_handle_event(struct recovd_obd *recovd) { ENTRY; - spin_lock(&recovd->recovd_lock); if (!(recovd->recovd_flags & RECOVD_UPCALL_WAIT) && recovd->recovd_flags & RECOVD_FAIL) { @@ -128,26 +127,26 @@ static int recovd_handle_event(struct recovd_obd *recovd) } if (recovd->recovd_flags & RECOVD_UPCALL_ANSWER) { - struct list_head *tmp, *pos; CERROR("UPCALL_WAITING: upcall answer\n"); CERROR("** fill me in with recovery\n"); - list_for_each_safe(tmp, pos, &recovd->recovd_troubled_lh) { - struct ptlrpc_client *cli = list_entry - (tmp, struct ptlrpc_client, cli_ha_item); + while (!list_empty(&recovd->recovd_troubled_lh)) { + struct ptlrpc_client *cli = + list_entry(recovd->recovd_troubled_lh.next, + struct ptlrpc_client, cli_ha_item); list_del(&cli->cli_ha_item); - spin_unlock(&recovd->recovd_lock); - if (cli->cli_recover) + if (cli->cli_recover) { + spin_unlock(&recovd->recovd_lock); cli->cli_recover(cli); - spin_lock(&recovd->recovd_lock); + spin_lock(&recovd->recovd_lock); + } } recovd->recovd_timeout = 0; recovd->recovd_flags = RECOVD_IDLE; } - spin_unlock(&recovd->recovd_lock); RETURN(0); }