summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c6
-rw-r--r--xlators/nfs/server/src/nlm4.c14
-rw-r--r--xlators/protocol/client/src/client.c11
3 files changed, 27 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 4b84039df..6bfcd6c00 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -888,6 +888,9 @@ glusterd_friend_cleanup (glusterd_peerinfo_t *peerinfo)
glusterd_peerctx_t *peerctx = NULL;
if (peerinfo->rpc) {
+ /* cleanup the saved-frames before last unref */
+ rpc_clnt_connection_cleanup (&peerinfo->rpc->conn);
+
peerctx = peerinfo->rpc->mydata;
peerinfo->rpc->mydata = NULL;
peerinfo->rpc = rpc_clnt_unref (peerinfo->rpc);
@@ -1299,6 +1302,9 @@ glusterd_brick_disconnect (glusterd_brickinfo_t *brickinfo)
GF_ASSERT (brickinfo);
if (brickinfo->rpc) {
+ /* cleanup the saved-frames before last unref */
+ rpc_clnt_connection_cleanup (&brickinfo->rpc->conn);
+
rpc_clnt_unref (brickinfo->rpc);
brickinfo->rpc = NULL;
}
diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c
index 0a0d26366..16507d069 100644
--- a/xlators/nfs/server/src/nlm4.c
+++ b/xlators/nfs/server/src/nlm4.c
@@ -315,8 +315,14 @@ nlm_set_rpc_clnt (rpc_clnt_t *rpc_clnt, char *caller_name)
ret = 0;
ret:
UNLOCK (&nlm_client_list_lk);
- if (rpc_clnt_old)
+
+ if (rpc_clnt_old) {
+ /* cleanup the saved-frames before last unref */
+ rpc_clnt_connection_cleanup (&rpc_clnt_old->conn);
+
rpc_clnt_unref (rpc_clnt_old);
+ }
+
if (old_name)
GF_FREE (old_name);
return ret;
@@ -340,8 +346,12 @@ nlm_unset_rpc_clnt (rpc_clnt_t *rpc)
if (rpc_clnt == NULL) {
return -1;
}
- if (rpc_clnt)
+ if (rpc_clnt) {
+ /* cleanup the saved-frames before last unref */
+ rpc_clnt_connection_cleanup (&rpc_clnt->conn);
+
rpc_clnt_unref (rpc_clnt);
+ }
return 0;
}
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index 078e6e5d0..93394ebfb 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -2199,6 +2199,9 @@ client_destroy_rpc (xlator_t *this)
goto out;
if (conf->rpc) {
+ /* cleanup the saved-frames before last unref */
+ rpc_clnt_connection_cleanup (&conf->rpc->conn);
+
conf->rpc = rpc_clnt_unref (conf->rpc);
ret = 0;
gf_log (this->name, GF_LOG_DEBUG,
@@ -2434,8 +2437,12 @@ fini (xlator_t *this)
this->private = NULL;
if (conf) {
- if (conf->rpc)
- rpc_clnt_unref (conf->rpc);
+ if (conf->rpc) {
+ /* cleanup the saved-frames before last unref */
+ rpc_clnt_connection_cleanup (&conf->rpc->conn);
+
+ rpc_clnt_unref (conf->rpc);
+ }
/* Saved Fds */
/* TODO: */