Whamcloud - gitweb
- fixed really nasty bug with recovery. Sometimes server sent _two_ replies for one...
authoryury <yury>
Mon, 25 Sep 2006 10:05:38 +0000 (10:05 +0000)
committeryury <yury>
Mon, 25 Sep 2006 10:05:38 +0000 (10:05 +0000)
- mor esimple recovery stuff in fld.

lustre/fld/fld_handler.c
lustre/fld/fld_internal.h
lustre/mdt/mdt_handler.c

index 319b957..3dd1803 100644 (file)
@@ -146,14 +146,14 @@ static int fld_server_handle(struct lu_server_fld *fld,
                                        mf->mf_seq, mf->mf_mds);
 
                 /* do not return -EEXIST error for resent case */
-                if ((info->fti_flags & FLD_MSG_RESENT) && rc == -EEXIST)
+                if ((info->fti_flags & MSG_RESENT) && rc == -EEXIST)
                         rc = 0;
                 break;
         case FLD_DELETE:
                 rc = fld_server_delete(fld, ctx, mf->mf_seq);
 
                 /* do not return -ENOENT error for resent case */
-                if ((info->fti_flags & FLD_MSG_RESENT) && rc == -ENOENT)
+                if ((info->fti_flags & MSG_RESENT) && rc == -ENOENT)
                         rc = 0;
                 break;
         case FLD_LOOKUP:
@@ -194,12 +194,6 @@ static int fld_req_handle(struct ptlrpc_request *req,
                         RETURN(-EPROTO);
                 *out = *in;
 
-                if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY)
-                        info->fti_flags |= FLD_MSG_REPLAY;
-
-                if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT)
-                        info->fti_flags |= FLD_MSG_RESENT;
-                
                 rc = fld_server_handle(site->ls_server_fld,
                                        req->rq_svc_thread->t_ctx,
                                        *opc, out, info);
@@ -214,7 +208,7 @@ static void fld_thread_info_init(struct ptlrpc_request *req,
 {
         int i;
 
-        info->fti_flags = 0;
+        info->fti_flags = lustre_msg_get_flags(req->rq_reqmsg);
         
         /* mark rep buffer as req-layout stuff expects */
         for (i = 0; i < ARRAY_SIZE(info->fti_rep_buf_size); i++)
index 0715ba4..db1e841 100644 (file)
@@ -50,11 +50,6 @@ enum {
 
 extern struct lu_fld_hash fld_hash[];
 
-enum {
-        FLD_MSG_RESENT = 1 << 0,
-        FLD_MSG_REPLAY = 1 << 1
-};
-
 #ifdef __KERNEL__
 struct fld_thread_info {
         struct req_capsule fti_pill;
index b4fa7c2..b269625 100644 (file)
@@ -1705,9 +1705,8 @@ static int mdt_recovery(struct mdt_thread_info *info)
                 int should_process;
 
                 rc = mds_filter_recovery_request(req, obd, &should_process);
-                if (rc != 0 || !should_process) {
+                if (rc != 0 || !should_process)
                         RETURN(rc);
-                }
         }
         RETURN(+1);
 }
@@ -1757,19 +1756,15 @@ static int mdt_handle0(struct ptlrpc_request *req,
         rc = mds_msg_check_version(msg);
         if (rc == 0) {
                 rc = mdt_recovery(info);
-                switch (rc) {
-                case +1:
+                if (rc == +1) {
                         h = mdt_handler_find(lustre_msg_get_opc(msg),
                                              supported);
-                        if (h != NULL)
+                        if (h != NULL) {
                                 rc = mdt_req_handle(info, h, req);
-                        else {
+                        else {
                                 req->rq_status = -ENOTSUPP;
                                 rc = ptlrpc_error(req);
-                                break;
                         }
-                        /* fall through */
-                case 0:
                         rc = mdt_reply(req, rc, info);
                 }
         } else