Whamcloud - gitweb
Branch HEAD
authortianzy <tianzy>
Mon, 14 Jan 2008 07:42:58 +0000 (07:42 +0000)
committertianzy <tianzy>
Mon, 14 Jan 2008 07:42:58 +0000 (07:42 +0000)
when mgs is rebooting or recovering, the mount req issued by mgc will fail
because mgs doesn't do recovery for mgc at all. The solution is: in this
situation, mgc will resend the req.
b=13464
i=nathan
i=adilger

lustre/ptlrpc/client.c

index e85a7f8..ba49a3f 100644 (file)
@@ -550,6 +550,9 @@ static int ptlrpc_import_delay_req(struct obd_import *imp,
                  imp->imp_state == LUSTRE_IMP_CONNECTING) {
                 /* allow CONNECT even if import is invalid */ ;
         } else if (imp->imp_invalid) {
+                /* if it is mgc, wait for recovry. b=13464 */
+                if (imp->imp_recon_bk && !imp->imp_obd->obd_no_recov)
+                        delay = 1;
                 /* If the import has been invalidated (such as by an OST
                  * failure) the request must fail with -ESHUTDOWN.  This
                  * indicates the requests should be discarded; an -EIO
@@ -1617,8 +1620,8 @@ int ptlrpc_queue_wait(struct ptlrpc_request *req)
         req->rq_phase = RQ_PHASE_RPC;
 
         spin_lock(&imp->imp_lock);
-        req->rq_import_generation = imp->imp_generation;
 restart:
+        req->rq_import_generation = imp->imp_generation;
         if (ptlrpc_import_delay_req(imp, req, &rc)) {
                 list_del(&req->rq_list);