From 7c4158b296f087073d6f69a66827a88ccc8cc82b Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 27 Mar 2009 09:52:17 +0000 Subject: [PATCH] Branch b1_8 b=18374 (patch from tappro) i=johann i=shadow don't reply with md and cookies during replay. --- lustre/mds/handler.c | 7 +++++++ lustre/mds/mds_reint.c | 15 ++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index a6db60d..1250648 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -1720,6 +1720,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; diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index 2a038e4..381b443 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -1945,9 +1945,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); @@ -2477,7 +2479,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 }; @@ -2591,9 +2593,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)); -- 1.8.3.1