Whamcloud - gitweb
LU-2730 mdt: fix erroneous LASSERT in mdt_reint_opcode
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Wed, 13 Feb 2013 14:33:30 +0000 (09:33 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 12 Mar 2013 05:03:20 +0000 (01:03 -0400)
Only set return code err_serious(-EFAULT) when neccessary and do not
run unknown opcode through err_serious.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Iea616d8afd676ee5ccda52cf09b398198f38f992
Reviewed-on: http://review.whamcloud.com/5416
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/mdt/mdt_handler.c

index a27a9d3..02dcdb8 100644 (file)
@@ -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)