From 02b4de3c1a33dd6a37c62d0edc8307adb52638b7 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Fri, 4 Nov 2011 14:51:04 +0530 Subject: nfs: do not return -1 (error), if the transmission buffer list is empty In the rpc implementation of nfs suppose the transmission buffer list is empty for the nfs server, -1 is being returned which is treated as an error and the socket fd is closed to handle it. Because of this the reply submission of the server will be failed. Thus if the transmission buffer list is empty error should not be returned. Change-Id: I42d0dada8fe0473daf4db085da10681d4926e1ae BUG: 3765 Reviewed-on: http://review.gluster.com/671 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/nfs/lib/src/rpcsvc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xlators/nfs/lib/src/rpcsvc.c b/xlators/nfs/lib/src/rpcsvc.c index 5798aa66934..1767db0ba03 100644 --- a/xlators/nfs/lib/src/rpcsvc.c +++ b/xlators/nfs/lib/src/rpcsvc.c @@ -2576,6 +2576,13 @@ __nfs_rpcsvc_conn_data_poll_out (rpcsvc_conn_t *conn) if (!conn) return -1; + /* If the transmission buffer list is empty, do not return -1 */ + if (list_empty (&conn->txbufs)) { + gf_log (GF_RPCSVC, GF_LOG_DEBUG, "transmission buffer list for " + "the connection %p is empty. Returning 0", conn); + written = 0; + } + /* Attempt transmission of each of the pending buffers */ list_for_each_entry_safe (txbuf, tmp, &conn->txbufs, txlist) { tx_remaining: -- cgit