Patchwork [BUG:2452] Make sure we are looking at the right errno in the fix for bug 2452.

login
register
Submitter Pavan
Date 2011-03-04 07:14:22
Message ID <1299222862-17265-1-git-send-email-tcp@gluster.com>
Download mbox | patch
Permalink /patch/6333/
State Accepted
Headers show

Comments

Pavan - 2011-03-04 07:14:22
From: Pavan T C <tcp@gluster.com>


Signed-off-by: Pavan T C <tcp@gluster.com>
---
 xlators/nfs/lib/src/rpcsvc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch

diff --git a/xlators/nfs/lib/src/rpcsvc.c b/xlators/nfs/lib/src/rpcsvc.c
index 84ee7bc..987c240 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