summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src/rpcsvc.h
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2012-12-06 16:46:57 +0530
committerAnand Avati <avati@redhat.com>2012-12-09 21:59:41 -0800
commitff33ea5175b98e0df743ae3af7681fcf1e1e89eb (patch)
tree900b2a2fd645eaa0dbdd7dfe17f396d6a219d762 /rpc/rpc-lib/src/rpcsvc.h
parentd0b0e59952222c186120c91518ccf94862a86f64 (diff)
rpcsvc: do a 'iobuf_ref()' on buffer while synctaskizing actor
Starting rpc actors using synctask causes rpcsvc to return before the actor actually finishes its actions. This would cause the buffer to be unreffed by socket and be possibly reused, before the actor used it, leading to failures in the actor. This patch makes rpcsvc take a ref on the buffer when synctaskizing the actor and store it in the request structure, and then later unref it when the request structure is destroyed. This makes sure that the buffer is not reused before the actor has finished. Change-Id: I8f81e1fef8f3719db220471d2d8ffb8916958956 BUG: 884452 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/4277 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'rpc/rpc-lib/src/rpcsvc.h')
-rw-r--r--rpc/rpc-lib/src/rpcsvc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.h b/rpc/rpc-lib/src/rpcsvc.h
index 5a0ddc9da9d..39ae383f4a2 100644
--- a/rpc/rpc-lib/src/rpcsvc.h
+++ b/rpc/rpc-lib/src/rpcsvc.h
@@ -234,6 +234,9 @@ struct rpcsvc_request {
/* Container for transport to store request-specific item */
void *trans_private;
+
+ /* we need to ref the 'iobuf' in case of 'synctasking' it */
+ struct iobuf *hdr_iobuf;
};
#define rpcsvc_request_program(req) ((rpcsvc_program_t *)((req)->prog))