summaryrefslogtreecommitdiffstats
path: root/xlators/features/quota/src/quotad-helpers.c
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2015-04-24 17:31:03 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-05 06:29:20 -0700
commit783d78de250ba4159e5c59cdf476305ccb0814ec (patch)
tree76b8339aa76b6fb50d38707197f96eac9d2c9547 /xlators/features/quota/src/quotad-helpers.c
parent1a89389834b646acaecf4791eeec9d29b6be6f1f (diff)
rpc: Maintain separate xlator pointer in 'rpcsvc_state'
The structure 'rpcsvc_state', which maintains rpc server state had no separate pointer to track the translator. It was using the mydata pointer itself. So callers were forced to send xlator pointer as mydata which is opaque (void pointer) by function prototype. 'rpcsvc_register_init' is setting svc->mydata with xlator pointer. 'rpcsvc_register_notify' is overwriting svc->mydata with mydata pointer. And rpc interprets svc->mydata as xlator pointer internally. If someone passes non xlator structure pointer to rpcsvc_register_notify as libgfchangelog currently does, it might corrupt mydata. So interpreting opaque mydata as xlator pointer is incorrect as it is caller's choice to send mydata as any type of data to 'rpcsvc_register_notify'. Maintaining two different pointers in 'rpcsvc_state' for xlator and mydata solves the issue. BUG: 1218381 Change-Id: I4c28937a30845e3f41b6fc7a09036149c816659b Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/10366 Reviewed-on: http://review.gluster.org/10534 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/quota/src/quotad-helpers.c')
-rw-r--r--xlators/features/quota/src/quotad-helpers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/features/quota/src/quotad-helpers.c b/xlators/features/quota/src/quotad-helpers.c
index 9a98ab17a24..70298fc87f5 100644
--- a/xlators/features/quota/src/quotad-helpers.c
+++ b/xlators/features/quota/src/quotad-helpers.c
@@ -62,7 +62,7 @@ quotad_aggregator_alloc_frame (rpcsvc_request_t *req)
GF_VALIDATE_OR_GOTO ("server", req->svc, out);
GF_VALIDATE_OR_GOTO ("server", req->svc->ctx, out);
- this = req->svc->mydata;
+ this = req->svc->xl;
frame = create_frame (this, req->svc->ctx->pool);
if (!frame)