Whamcloud - gitweb
- fixed bug with handling replaying and resending FLD and SEQ RPCs. obd->obd_recovery...
authoryury <yury>
Fri, 22 Sep 2006 20:02:53 +0000 (20:02 +0000)
committeryury <yury>
Fri, 22 Sep 2006 20:02:53 +0000 (20:02 +0000)
 target_handle_connect() time should be aware of all requests types and act appropriate.

lustre/mdt/mdt_handler.c

index 67aaa5b..03dcf77 100644 (file)
@@ -124,6 +124,7 @@ static struct mdt_opc_slice mdt_fld_handlers[];
 
 static struct mdt_device *mdt_dev(struct lu_device *d);
 static int mdt_regular_handle(struct ptlrpc_request *req);
+static int mdt_recovery_handle(struct ptlrpc_request *req);
 static int mdt_unpack_req_pack_rep(struct mdt_thread_info *info, __u32 flags);
 
 static struct lu_object_operations mdt_obj_ops;
@@ -622,7 +623,7 @@ static int mdt_connect(struct mdt_thread_info *info)
         struct ptlrpc_request *req;
 
         req = mdt_info_req(info);
-        rc = target_handle_connect(req, mdt_regular_handle);
+        rc = target_handle_connect(req, mdt_recovery_handle);
         if (rc == 0) {
                 LASSERT(req->rq_export != NULL);
                 info->mti_mdt = mdt_dev(req->rq_export->exp_obd->obd_lu_dev);
@@ -1729,6 +1730,30 @@ static int mdt_handle_common(struct ptlrpc_request *req,
         RETURN(rc);
 }
 
+/*
+ * This is called from recovery code as handler of _all_ RPC types, FLD and SEQ
+ * as well.
+ */
+static int mdt_recovery_handle(struct ptlrpc_request *req)
+{
+        int rc;
+        ENTRY;
+        
+        switch (lustre_msg_get_opc(req->rq_reqmsg)) {
+        case FLD_QUERY:
+                rc = mdt_handle_common(req, mdt_fld_handlers);
+                break;
+        case SEQ_QUERY:
+                rc = mdt_handle_common(req, mdt_seq_handlers);
+                break;
+        default:
+                rc = mdt_handle_common(req, mdt_regular_handlers);
+                break;
+        }
+        
+        RETURN(rc);
+}
+
 static int mdt_regular_handle(struct ptlrpc_request *req)
 {
         return mdt_handle_common(req, mdt_regular_handlers);