Blob Blame History Raw
From 2ca720351ebd7f2382252e3313274c5edf636b47 Mon Sep 17 00:00:00 2001
From: Manikandan Selvaganesh <mselvaga@redhat.com>
Date: Fri, 26 Jun 2015 14:56:53 +0530
Subject: [PATCH 191/200] rdma : removing duplicate printing of error string in gf_msg

Change-Id: I206cf80392d430f35558cc11699402c4cef12527
BUG: 1231782
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-on: http://review.gluster.org/11426
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/51759
Reviewed-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
Tested-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
---
 rpc/rpc-transport/rdma/src/name.c |    9 +++---
 rpc/rpc-transport/rdma/src/rdma.c |   53 ++++++++++++++++---------------------
 2 files changed, 27 insertions(+), 35 deletions(-)

diff --git a/rpc/rpc-transport/rdma/src/name.c b/rpc/rpc-transport/rdma/src/name.c
index 97b2e37..8b403ed 100644
--- a/rpc/rpc-transport/rdma/src/name.c
+++ b/rpc/rpc-transport/rdma/src/name.c
@@ -397,8 +397,8 @@ af_inet_server_get_local_sockaddr (rpc_transport_t *this,
         if (ret != 0) {
                 gf_msg (this->name, GF_LOG_ERROR, ret,
                         TRANS_MSG_GET_ADDR_INFO_FAILED,
-                        "getaddrinfo failed for host %s, service %s (%s)",
-                        listen_host, service, gai_strerror (ret));
+                        "getaddrinfo failed for host %s, service %s",
+                        listen_host, service);
                 ret = -1;
                 goto out;
         }
@@ -432,8 +432,7 @@ gf_rdma_client_bind (rpc_transport_t *this, struct sockaddr *sockaddr,
                         gf_msg (this->name, GF_LOG_WARNING, errno,
                                 RDMA_MSG_PORT_BIND_FAILED,
                                 "cannot bind rdma_cm_id to port "
-                                "less than %d (%s)", GF_CLIENT_PORT_CEILING,
-                                strerror (errno));
+                                "less than %d", GF_CLIENT_PORT_CEILING);
                         if (sockaddr->sa_family == AF_INET6) {
                                 ((struct sockaddr_in6 *)sockaddr)->sin6_port
                                         = htons (0);
@@ -637,7 +636,7 @@ fill_inet6_inet_identifiers (rpc_transport_t *this, struct sockaddr_storage *add
         if (ret != 0) {
                 gf_msg (this->name, GF_LOG_ERROR, ret,
                         TRANS_MSG_GET_NAME_INFO_FAILED,
-                        "getnameinfo failed (%s)", gai_strerror (ret));
+                        "getnameinfo failed");
         }
 
         sprintf (identifier, "%s:%s", host, service);
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index 89fb6cb..630a660 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -120,8 +120,7 @@ gf_rdma_new_post (rpc_transport_t *this, gf_rdma_device_t *device, int32_t len,
         if (!post->mr) {
                 gf_msg (this->name, GF_LOG_WARNING, errno,
                         RDMA_MSG_MR_ALOC_FAILED,
-                        "memory registration failed (%s)",
-                        strerror (errno));
+                        "memory registration failed");
                 goto out;
         }
 
@@ -1034,8 +1033,8 @@ gf_rdma_cm_handle_connect_request (struct rdma_cm_event *event)
         if (ret < 0) {
                 gf_msg (listener->name, GF_LOG_WARNING, errno,
                         RDMA_MSG_ACCEPT_FAILED, "rdma_accept failed peer:%s "
-                        "me:%s (%s)", this->peerinfo.identifier,
-                        this->myinfo.identifier, strerror (errno));
+                        "me:%s", this->peerinfo.identifier,
+                        this->myinfo.identifier);
                 gf_rdma_cm_handle_disconnect (this);
                 goto out;
         }
@@ -1087,7 +1086,7 @@ gf_rdma_cm_handle_route_resolved (struct rdma_cm_event *event)
         if (ret != 0) {
                 gf_msg (this->name, GF_LOG_WARNING, errno,
                         RDMA_MSG_CONNECT_FAILED,
-                        "rdma_connect failed (%s)", strerror (errno));
+                        "rdma_connect failed");
                 gf_rdma_cm_handle_disconnect (this);
                 goto out;
         }
@@ -1130,9 +1129,8 @@ gf_rdma_cm_handle_addr_resolved (struct rdma_cm_event *event)
         if (ret != 0) {
                 gf_msg (this->name, GF_LOG_WARNING, errno,
                         RDMA_MSG_ROUTE_RESOLVE_FAILED, "rdma_resolve_route "
-                        "failed (me:%s peer:%s) (%s)",
-                        this->myinfo.identifier, this->peerinfo.identifier,
-                        strerror (errno));
+                        "failed (me:%s peer:%s)",
+                        this->myinfo.identifier, this->peerinfo.identifier);
                 gf_rdma_cm_handle_disconnect (this);
         }
 
@@ -1257,8 +1255,7 @@ gf_rdma_cm_event_handler (void *data)
                 if (ret != 0) {
                         gf_msg (GF_RDMA_LOG_NAME, GF_LOG_WARNING, errno,
                                 RDMA_MSG_CM_EVENT_FAILED,
-                                "rdma_cm_get_event failed (%s)",
-                                strerror (errno));
+                                "rdma_cm_get_event failed");
                         break;
                 }
 
@@ -1464,8 +1461,7 @@ __gf_rdma_create_read_chunks_from_vector (gf_rdma_peer_t *peer,
                 if (!mr) {
                         gf_msg (GF_RDMA_LOG_NAME, GF_LOG_WARNING, errno,
                                 RDMA_MSG_MR_ALOC_FAILED,
-                                "memory registration failed (%s) (peer:%s)",
-                                strerror (errno),
+                                "memory registration failed (peer:%s)",
                                 peer->trans->peerinfo.identifier);
                         goto out;
                 }
@@ -1611,8 +1607,7 @@ __gf_rdma_create_write_chunks_from_vector (gf_rdma_peer_t *peer,
                 if (!mr) {
                         gf_msg (GF_RDMA_LOG_NAME, GF_LOG_WARNING, errno,
                                 RDMA_MSG_MR_ALOC_FAILED, "memory "
-                                "registration failed (%s) (peer:%s)",
-                                strerror (errno),
+                                "registration failed (peer:%s)",
                                 peer->trans->peerinfo.identifier);
                         goto out;
                 }
@@ -2331,7 +2326,7 @@ __gf_rdma_register_local_mr_for_rdma (gf_rdma_peer_t *peer,
                         gf_msg (GF_RDMA_LOG_NAME, GF_LOG_WARNING, errno,
                                 RDMA_MSG_MR_ALOC_FAILED,
                                 "registering memory for IBV_ACCESS_LOCAL_WRITE"
-                                " failed (%s)", strerror (errno));
+                                " failed");
                         goto out;
                 }
 
@@ -3231,8 +3226,8 @@ gf_rdma_create_qp (rpc_transport_t *this)
         ret = rdma_create_qp(peer->cm_id, device->pd, &init_attr);
         if (ret != 0) {
                 gf_msg (peer->trans->name, GF_LOG_CRITICAL, errno,
-                        RDMA_MSG_CREAT_QP_FAILED, "%s: could not create QP "
-                        "(%s)", this->name, strerror (errno));
+                        RDMA_MSG_CREAT_QP_FAILED, "%s: could not create QP",
+                        this->name);
                 ret = -1;
                 goto out;
         }
@@ -4121,7 +4116,7 @@ gf_rdma_async_event_thread (void *context)
                         if (ret && errno != EINTR) {
                                 gf_msg (GF_RDMA_LOG_NAME, GF_LOG_WARNING, errno,
                                         RDMA_MSG_EVENT_ERROR, "Error getting "
-                                        "event (%s)", strerror (errno));
+                                        "event");
                         }
                 } while (ret && errno == EINTR);
 
@@ -4592,7 +4587,7 @@ __gf_rdma_ctx_create (void)
         if (rdma_ctx->rdma_cm_event_channel == NULL) {
                 gf_msg (GF_RDMA_LOG_NAME, GF_LOG_WARNING, errno,
                         RDMA_MSG_CM_EVENT_FAILED, "rdma_cm event channel "
-                        "creation failed (%s)", strerror (errno));
+                        "creation failed");
                 goto out;
         }
 
@@ -4602,7 +4597,7 @@ __gf_rdma_ctx_create (void)
         if (ret != 0) {
                 gf_msg (GF_RDMA_LOG_NAME, GF_LOG_WARNING, ret,
                         RDMA_MSG_CM_EVENT_FAILED, "creation of thread to "
-                        "handle rdma-cm events failed (%s)", strerror (ret));
+                        "handle rdma-cm events failed");
                 goto out;
         }
 
@@ -4727,7 +4722,7 @@ gf_rdma_connect (struct rpc_transport *this, int port)
                 if (ret != 0) {
                         gf_msg (this->name, GF_LOG_ERROR, errno,
                                 RDMA_MSG_CM_EVENT_FAILED, "creation of "
-                                "rdma_cm_id failed (%s)", strerror (errno));
+                                "rdma_cm_id failed");
                         ret = -errno;
                         goto unlock;
                 }
@@ -4749,7 +4744,7 @@ gf_rdma_connect (struct rpc_transport *this, int port)
                 if (ret != 0) {
                         gf_msg (this->name, GF_LOG_WARNING, errno,
                                 RDMA_MSG_CLIENT_BIND_FAILED,
-                                "client bind failed: %s", strerror (errno));
+                                "client bind failed");
                         goto unlock;
                 }
 
@@ -4758,8 +4753,7 @@ gf_rdma_connect (struct rpc_transport *this, int port)
                 if (ret != 0) {
                         gf_msg (this->name, GF_LOG_WARNING, errno,
                                 RDMA_MSG_RDMA_RESOLVE_ADDR_FAILED,
-                                "rdma_resolve_addr failed (%s)",
-                                strerror (errno));
+                                "rdma_resolve_addr failed");
                         goto unlock;
                 }
 
@@ -4814,7 +4808,7 @@ gf_rdma_listen (rpc_transport_t *this)
         if (ret != 0) {
                 gf_msg (this->name, GF_LOG_WARNING, errno,
                         RDMA_MSG_CM_EVENT_FAILED, "creation of rdma_cm_id "
-                        "failed (%s)", strerror (errno));
+                        "failed");
                 goto err;
         }
 
@@ -4829,7 +4823,7 @@ gf_rdma_listen (rpc_transport_t *this)
         if (ret != 0) {
                 gf_msg (this->name, GF_LOG_ERROR, ret,
                         TRANS_MSG_GET_NAME_INFO_FAILED,
-                        "getnameinfo failed (%s)", gai_strerror (ret));
+                        "getnameinfo failed");
                 goto err;
         }
 
@@ -4840,8 +4834,7 @@ gf_rdma_listen (rpc_transport_t *this)
                               (void *)&optval, sizeof(optval));
         if (ret != 0) {
                 gf_msg (this->name, GF_LOG_WARNING, errno,
-                        RDMA_MSG_OPTION_SET_FAILED, "rdma option set failed "
-                        "(%s)", strerror (errno));
+                        RDMA_MSG_OPTION_SET_FAILED, "rdma option set failed");
                 goto err;
         }
 
@@ -4849,7 +4842,7 @@ gf_rdma_listen (rpc_transport_t *this)
         if (ret != 0) {
                 gf_msg (this->name, GF_LOG_WARNING, errno,
                         RDMA_MSG_RDMA_BIND_ADDR_FAILED,
-                        "rdma_bind_addr failed (%s)", strerror (errno));
+                        "rdma_bind_addr failed");
                 goto err;
         }
 
@@ -4857,7 +4850,7 @@ gf_rdma_listen (rpc_transport_t *this)
         if (ret != 0) {
                 gf_msg (this->name, GF_LOG_WARNING, errno,
                         RDMA_MSG_LISTEN_FAILED,
-                        "rdma_listen failed (%s)", strerror (errno));
+                        "rdma_listen failed");
                 goto err;
         }
 
-- 
1.7.1