From c42102f7f5204b8f6c51e409603982a026ce1136 Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Wed, 13 Feb 2013 09:33:30 -0500 Subject: [PATCH] LU-2730 mdt: fix erroneous LASSERT in mdt_reint_opcode Only set return code err_serious(-EFAULT) when neccessary and do not run unknown opcode through err_serious. Signed-off-by: Nathaniel Clark Change-Id: Iea616d8afd676ee5ccda52cf09b398198f38f992 Reviewed-on: http://review.whamcloud.com/5416 Tested-by: Hudson Reviewed-by: Andreas Dilger Reviewed-by: wangdi Tested-by: Maloo --- lustre/mdt/mdt_handler.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index a27a9d3..02dcdb8 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1770,24 +1770,28 @@ out_shrink: } static long mdt_reint_opcode(struct mdt_thread_info *info, - const struct req_format **fmt) -{ - struct mdt_rec_reint *rec; - long opc; - - opc = err_serious(-EFAULT); - rec = req_capsule_client_get(info->mti_pill, &RMF_REC_REINT); - if (rec != NULL) { - opc = rec->rr_opcode; - DEBUG_REQ(D_INODE, mdt_info_req(info), "reint opt = %ld", opc); - if (opc < REINT_MAX && fmt[opc] != NULL) - req_capsule_extend(info->mti_pill, fmt[opc]); - else { - CERROR("Unsupported opc: %ld\n", opc); - opc = err_serious(opc); - } - } - return opc; + const struct req_format **fmt) +{ + struct mdt_rec_reint *rec; + long opc; + + rec = req_capsule_client_get(info->mti_pill, &RMF_REC_REINT); + if (rec != NULL) { + opc = rec->rr_opcode; + DEBUG_REQ(D_INODE, mdt_info_req(info), "reint opt = %ld", opc); + if (opc < REINT_MAX && fmt[opc] != NULL) + req_capsule_extend(info->mti_pill, fmt[opc]); + else { + CERROR("%s: Unsupported opcode '%ld' from client '%s': " + "rc = %d\n", mdt_obd_name(info->mti_mdt), opc, + info->mti_mdt->mdt_ldlm_client->cli_name, + -EFAULT); + opc = err_serious(-EFAULT); + } + } else { + opc = err_serious(-EFAULT); + } + return opc; } int mdt_reint(struct mdt_thread_info *info) -- 1.8.3.1