Patchwork rpcsvc: perform mem_put at the very end for safe unrefs

login
register
Submitter Anand Avati
Date 2011-03-01 20:10:27
Message ID <20110301201027.GA27983@dev.gluster.com>
Download mbox | patch
Permalink /patch/6318/
State Accepted
Headers show

Comments

Anand Avati - 2011-03-01 20:10:27
Signed-off-by: Anand Avati <avati@gluster.com>
---
 xlators/nfs/lib/src/rpcsvc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/xlators/nfs/lib/src/rpcsvc.c b/xlators/nfs/lib/src/rpcsvc.c
index f75fe4c..cd9733e 100644
--- a/xlators/nfs/lib/src/rpcsvc.c
+++ b/xlators/nfs/lib/src/rpcsvc.c
@@ -1687,7 +1687,6 @@  nfs_rpcsvc_submit_generic (rpcsvc_request_t *req, struct iovec msgvec,
         if (msg)
                 iobuf_ref (msg);
         ret = nfs_rpcsvc_conn_submit (conn, recordhdr, replyiob, msgvec, msg);
-        mem_put (conn->rxpool, req);
 
         if (ret == -1) {
                 gf_log (GF_RPCSVC, GF_LOG_ERROR, "Failed to submit message");
@@ -1710,6 +1709,8 @@  disconnect_exit:
             (nfs_rpcsvc_request_accepted_success (req)))
                 nfs_rpcsvc_conn_unref (conn);
 
+        mem_put (conn->rxpool, req);
+
         return ret;
 }