summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol/server/src')
-rw-r--r--xlators/protocol/server/src/server-handshake.c5
-rw-r--r--xlators/protocol/server/src/server-helpers.c4
-rw-r--r--xlators/protocol/server/src/server.c12
3 files changed, 11 insertions, 10 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c
index 98418e77893..9396499cc3d 100644
--- a/xlators/protocol/server/src/server-handshake.c
+++ b/xlators/protocol/server/src/server-handshake.c
@@ -757,12 +757,13 @@ server_set_lk_version (rpcsvc_request_t *req)
}
serv_ctx->lk_version = args.lk_ver;
- gf_client_put (client, NULL);
-
rsp.lk_ver = args.lk_ver;
op_ret = 0;
fail:
+ if (client)
+ gf_client_put (client, NULL);
+
rsp.op_ret = op_ret;
rsp.op_errno = op_errno;
server_submit_reply (NULL, req, &rsp, NULL, 0, NULL,
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index ebeaf90c4a7..dbd26539b2f 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -242,7 +242,6 @@ server_connection_cleanup_flush_cbk (call_frame_t *frame, void *cookie,
client_t *client = NULL;
GF_VALIDATE_OR_GOTO ("server", this, out);
- GF_VALIDATE_OR_GOTO ("server", cookie, out);
GF_VALIDATE_OR_GOTO ("server", frame, out);
fd = frame->local;
@@ -298,9 +297,9 @@ do_fd_cleanup (xlator_t *this, client_t* client, fdentry_t *fdentries, int fd_co
}
tmp_frame->local = fd;
-
tmp_frame->root->pid = 0;
gf_client_ref (client);
+ tmp_frame->root->client = client;
memset (&tmp_frame->root->lk_owner, 0,
sizeof (gf_lkowner_t));
@@ -1098,6 +1097,7 @@ server_ctx_get (client_t *client, xlator_t *xlator)
if (client_ctx_set (client, xlator, ctx) != 0) {
LOCK_DESTROY (&ctx->fdtable_lock);
+ GF_FREE (ctx->fdtable);
GF_FREE (ctx);
ctx = NULL;
}
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 60092a557de..3de856e8e09 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -201,18 +201,18 @@ server_submit_reply (call_frame_t *frame, rpcsvc_request_t *req, void *arg,
ret = 0;
ret:
- if (state) {
+ if (state)
free_state (state);
- }
- if (frame) {
+ if (client)
gf_client_unref (client);
+
+ if (frame)
STACK_DESTROY (frame->root);
- }
- if (new_iobref) {
+ if (new_iobref)
iobref_unref (iobref);
- }
+
return ret;
}