summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2013-01-11 14:53:50 +0530
committerVijay Bellur <vbellur@redhat.com>2013-01-15 02:25:11 -0800
commita65a482dc2f09de3e1115c593864248522eea29e (patch)
tree4fda5d02d69e0e3c9f5726f1f32b86fe720f9e11 /rpc
parentfd32c05f461efd48e46d879cdba85a2fe894a2e0 (diff)
socket: Don't log readv failures if read-fail-log is false
Change-Id: I6903d62cbc7107eb8498bcd81d07667b36890a02 BUG: 764888 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/4377 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index ae574f5f5..830aece05 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -148,10 +148,12 @@ typedef int SSL_trinary_func (SSL *, void *, int);
&in->pending_count, \
&bytes_read); \
if (ret == -1) { \
- gf_log (this->name, GF_LOG_WARNING, \
- "reading from socket failed. Error (%s), " \
- "peer (%s)", strerror (errno), \
- this->peerinfo.identifier); \
+ if (priv->read_fail_log) \
+ gf_log (this->name, GF_LOG_WARNING, \
+ "reading from socket failed." \
+ "Error (%s), peer (%s)", \
+ strerror (errno), \
+ this->peerinfo.identifier); \
break; \
} \
__socket_proto_update_priv_after_read (priv, ret, bytes_read); \
@@ -496,9 +498,11 @@ __socket_rwv (rpc_transport_t *this, struct iovec *vector, int count,
if (errno == EINTR)
continue;
- gf_log (this->name, GF_LOG_WARNING,
- "%s failed (%s)", write ? "writev" : "readv",
- strerror (errno));
+ if (write || (!write && priv->read_fail_log))
+ gf_log (this->name, GF_LOG_WARNING,
+ "%s failed (%s)",
+ write ? "writev":"readv",
+ strerror (errno));
if (priv->use_ssl) {
ssl_dump_error_stack(this->name);
}