Whamcloud - gitweb
LU-1407 msg: Wrong error messages on MDS and Client
authoryangsheng <ys@whamcloud.com>
Mon, 11 Jun 2012 08:43:12 +0000 (16:43 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 23 Aug 2012 13:47:43 +0000 (09:47 -0400)
Don't show error messages on console in some case.

Signed-off-by: yang sheng <ys@whamcloud.com>
Change-Id: I0b8b1bb523f677813b2f3998509afba639398d9d
Reviewed-on: http://review.whamcloud.com/3076
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/client.c
lustre/ptlrpc/niobuf.c

index 35b1443..727425a 100644 (file)
@@ -1191,24 +1191,6 @@ static int ptlrpc_check_status(struct ptlrpc_request *req)
         if (lustre_msg_get_type(req->rq_repmsg) == PTL_RPC_MSG_ERR) {
                 struct obd_import *imp = req->rq_import;
                 __u32 opc = lustre_msg_get_opc(req->rq_reqmsg);
-                LCONSOLE_ERROR_MSG(0x011,"an error occurred while communicating"
-                                " with %s. The %s operation failed with %d\n",
-                                libcfs_nid2str(imp->imp_connection->c_peer.nid),
-                                ll_opcode2str(opc), err);
-                RETURN(err < 0 ? err : -EINVAL);
-        }
-
-        if (err < 0) {
-                DEBUG_REQ(D_INFO, req, "status is %d", err);
-        } else if (err > 0) {
-                /* XXX: translate this error from net to host */
-                DEBUG_REQ(D_INFO, req, "status is %d", err);
-        }
-
-        if (lustre_msg_get_type(req->rq_repmsg) == PTL_RPC_MSG_ERR) {
-                struct obd_import *imp = req->rq_import;
-                __u32 opc = lustre_msg_get_opc(req->rq_reqmsg);
-
                 if (ptlrpc_console_allow(req))
                         LCONSOLE_ERROR_MSG(0x011,"an error occurred while "
                                            "communicating with %s. The %s "
@@ -1216,10 +1198,16 @@ static int ptlrpc_check_status(struct ptlrpc_request *req)
                                            libcfs_nid2str(
                                            imp->imp_connection->c_peer.nid),
                                            ll_opcode2str(opc), err);
-
                 RETURN(err < 0 ? err : -EINVAL);
         }
 
+        if (err < 0) {
+                DEBUG_REQ(D_INFO, req, "status is %d", err);
+        } else if (err > 0) {
+                /* XXX: translate this error from net to host */
+                DEBUG_REQ(D_INFO, req, "status is %d", err);
+        }
+
         RETURN(err);
 }
 
index b0d3a52..671cee3 100644 (file)
@@ -563,7 +563,9 @@ int ptlrpc_send_error(struct ptlrpc_request *req, int may_be_difficult)
                         RETURN(rc);
         }
 
-        req->rq_type = PTL_RPC_MSG_ERR;
+        if (req->rq_status != -ENOSPC && req->rq_status != -EACCES &&
+            req->rq_status != -EPERM && req->rq_status != -ENOENT)
+                req->rq_type = PTL_RPC_MSG_ERR;
 
         rc = ptlrpc_send_reply(req, may_be_difficult);
         RETURN(rc);