From: Nathaniel Clark Date: Wed, 13 Feb 2013 14:33:30 +0000 (-0500) Subject: LU-2730 mdt: fix erroneous LASSERT in mdt_reint_opcode X-Git-Tag: 2.3.63~85 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c42102f7f5204b8f6c51e409603982a026ce1136 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 --- 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)