summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-helpers.c
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2017-08-30 11:25:29 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-08-31 03:45:09 +0000
commit24b95089a18a6a40e7703cb344e92025d67f3086 (patch)
tree66be15d199b010f40c765d89dd70576c27822367 /xlators/protocol/server/src/server-helpers.c
parenta4c43ba9374b8f75a48d38a032353a0c7d311a73 (diff)
downloadglusterfs-24b95089a18a6a40e7703cb344e92025d67f3086.tar.gz
glusterfs-24b95089a18a6a40e7703cb344e92025d67f3086.tar.xz
glusterfs-24b95089a18a6a40e7703cb344e92025d67f3086.zip
rpc: destroy transport after client_t
Problem: 1. Ref counting increment on the client_t object is done in rpcsvc_request_init() which is incorrect. 2. Ref not taken when delegating to grace_time_handler() Solution: 1. Only fop requests which require processing down the graph via stack 'frames' now ref count the request in get_frame_from_request() 2. Take ref on client_t object in server_rpc_notify() but avoid dropping in RPCSVC_EVENT_TRANSPORT_DESRTROY. Drop the ref unconditionally when exiting out of grace_time_handler(). Also, avoid dropping ref on client_t in RPCSVC_EVENT_TRANSPORT_DESTROY when ref mangement as been delegated to grace_time_handler() Change-Id: Ic16246bebc7ea4490545b26564658f4b081675e4 BUG: 1481600 Reported-by: Raghavendra G <rgowdapp@redhat.com> Signed-off-by: Milind Changire <mchangir@redhat.com> Reviewed-on: https://review.gluster.org/17982 Tested-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/protocol/server/src/server-helpers.c')
-rw-r--r--xlators/protocol/server/src/server-helpers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index e6def55c74..a639a780b8 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -490,6 +490,10 @@ get_frame_from_request (rpcsvc_request_t *req)
}
}
+ /* Add a ref for this fop */
+ if (client)
+ gf_client_ref (client);
+
frame->root->uid = req->uid;
frame->root->gid = req->gid;
frame->root->pid = req->pid;