Whamcloud - gitweb
Branch b1_6
authorjohann <johann>
Fri, 27 Mar 2009 09:52:57 +0000 (09:52 +0000)
committerjohann <johann>
Fri, 27 Mar 2009 09:52:57 +0000 (09:52 +0000)
b=18374 (patch from tappro)
i=johann
i=shadow

don't reply with md and cookies during replay.

lustre/mds/handler.c
lustre/mds/mds_reint.c

index 9e1e340..5713d83 100644 (file)
@@ -1780,6 +1780,13 @@ int mds_handle(struct ptlrpc_request *req)
                 else
                         bufcount = 2;
 
+                /* if we do recovery we isn't send reply mds state is restored */
+                if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) {
+                        size[DLM_REPLY_REC_OFF] = 0;
+                        if (opc == REINT_UNLINK || opc == REINT_RENAME)
+                                size[DLM_REPLY_REC_OFF + 1] = 0;
+                }
+
                 rc = lustre_pack_reply(req, bufcount, size, NULL);
                 if (rc)
                         break;
index 3937d5c..691305d 100644 (file)
@@ -1771,9 +1771,11 @@ static int mds_reint_unlink(struct mds_update_record *rec, int offset,
         case S_IFREG: {
                 struct lov_mds_md *lmm = lustre_msg_buf(req->rq_repmsg,
                                                         offset + 1, 0);
+                int sz = lustre_msg_buflen(req->rq_repmsg, offset + 1) > 0 ?
+                         le32_to_cpu(lmm->lmm_stripe_count) : 0;
+
                 handle = fsfilt_start_log(obd, dparent->d_inode,
-                                          FSFILT_OP_UNLINK, NULL,
-                                          le32_to_cpu(lmm->lmm_stripe_count));
+                                          FSFILT_OP_UNLINK, NULL, sz);
                 if (IS_ERR(handle))
                         GOTO(cleanup, rc = PTR_ERR(handle));
                 LOCK_INODE_MUTEX(dparent->d_inode);
@@ -2286,7 +2288,7 @@ static int mds_reint_rename(struct mds_update_record *rec, int offset,
         struct lustre_handle dlm_handles[4];
         struct mds_body *body = NULL;
         struct lov_mds_md *lmm = NULL;
-        int rc = 0, lock_count = 3, cleanup_phase = 0;
+        int rc = 0, lock_count = 3, cleanup_phase = 0, sz;
         void *handle = NULL;
         unsigned int qcids[MAXQUOTAS] = { 0, 0 };
         unsigned int qpids[4] = { 0, 0, 0, 0 };
@@ -2386,9 +2388,12 @@ no_unlink:
                 GOTO(cleanup, rc = -EINVAL);
 
         lmm = lustre_msg_buf(req->rq_repmsg, offset + 1, 0);
-        handle = fsfilt_start_log(obd, de_tgtdir->d_inode, FSFILT_OP_RENAME,
-                                  NULL, le32_to_cpu(lmm->lmm_stripe_count));
+        /* check that lmm size is not 0 */
+        sz = lustre_msg_buflen(req->rq_repmsg, offset + 1) > 0 ?
+             le32_to_cpu(lmm->lmm_stripe_count) : 0;
 
+        handle = fsfilt_start_log(obd, de_tgtdir->d_inode, FSFILT_OP_RENAME,
+                                  NULL, sz);
         if (IS_ERR(handle))
                 GOTO(cleanup, rc = PTR_ERR(handle));