summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavan T C <tcp@gluster.com>2011-03-04 01:44:22 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-03-03 23:30:08 -0800
commitdae57d72a58ff61fe6eda800d386bf83574ef5c2 (patch)
tree63a3684a06c29059266f94c814d5a915f17f78b4
parent689c1b5044e701e1b695a6e6c80647b9471ba454 (diff)
Make sure we are looking at the right errno in the fix for bug 2452.
Signed-off-by: Pavan T C <tcp@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2452 (Excessive CPU usage /very low throughput while using NFS mounts) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2452
-rw-r--r--xlators/nfs/lib/src/rpcsvc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/nfs/lib/src/rpcsvc.c b/xlators/nfs/lib/src/rpcsvc.c
index 84ee7bc2234..987c24080fd 100644
--- a/xlators/nfs/lib/src/rpcsvc.c
+++ b/xlators/nfs/lib/src/rpcsvc.c
@@ -2542,6 +2542,7 @@ __nfs_rpcsvc_conn_data_poll_out (rpcsvc_conn_t *conn)
ssize_t written = -1;
char *writeaddr = NULL;
size_t writesize = -1;
+ int local_errno = 0;
if (!conn)
return -1;
@@ -2560,6 +2561,8 @@ tx_remaining:
errno = 0;
written = nfs_rpcsvc_socket_write (conn->sockfd, writeaddr,
writesize);
+ local_errno = errno;
+
if (txbuf->txbehave & RPCSVC_TXB_LAST) {
gf_log (GF_RPCSVC, GF_LOG_TRACE, "Last Tx Buf");
nfs_rpcsvc_socket_unblock_tx (conn->sockfd);
@@ -2578,7 +2581,7 @@ tx_remaining:
if (written >= 0)
txbuf->offset += written;
- if (errno == EAGAIN) {
+ if (local_errno == EAGAIN) {
/*
* Socket layer is indicating flow-control. We
* break-out now and wait for the next event indicating