diff options
author | Prasanna Kumar Kalever <prasanna.kalever@redhat.com> | 2017-09-18 19:49:10 +0530 |
---|---|---|
committer | Prasanna Kumar Kalever <pkalever@redhat.com> | 2017-09-19 04:07:48 +0000 |
commit | 3d0953aa99eed434a1977de3131b264c48fca64b (patch) | |
tree | bcf3008e0ced0365069a9414ee4efc85e0f96b09 /rpc/rpcl | |
parent | 2ab382593a3dea2e6ca2dc213bf735574933c10b (diff) |
rpc: switch to MT-safe block RPC routines
blockResponse *
block_delete_1(blockDelete *argp, CLIENT *clnt)
{
static blockResponse clnt_res; <<<<<<-------- Same memory is used by everyone
memset((char *)&clnt_res, 0, sizeof(clnt_res)); <<<<<---- Here memset is happening
if (clnt_call (clnt, BLOCK_DELETE,
(xdrproc_t) xdr_blockDelete, (caddr_t) argp,
(xdrproc_t) xdr_blockResponse, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res); <<<<<---- ptr to this memory is returned.
}
So while Thread-1 is returned "return (&clnt_res);" another thread could be
doing "memset((char *)&clnt_res, 0, sizeof(clnt_res));"
This seem to be a day-1 gluster-blockd bug from the looks of it.
Change-Id: I3fc76d7814c4fe5b286577586ec44d752dcc73f0
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'rpc/rpcl')
-rw-r--r-- | rpc/rpcl/Makefile.am | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rpc/rpcl/Makefile.am b/rpc/rpcl/Makefile.am index 38b1dbf..08a40ea 100644 --- a/rpc/rpcl/Makefile.am +++ b/rpc/rpcl/Makefile.am @@ -10,17 +10,17 @@ DISTCLEANFILES = Makefile.in $(BUILT_SOURCES) CLEANFILES = *~ $(BUILT_SOURCES) block.h: block.x - rpcgen -h -o $(top_builddir)/rpc/rpcl/$@ $^ + rpcgen -hM -o $(top_builddir)/rpc/rpcl/$@ $^ block_xdr.c: block.x - rpcgen -c -o $(top_builddir)/rpc/rpcl/$@ $^ + rpcgen -cM -o $(top_builddir)/rpc/rpcl/$@ $^ block_clnt.c: block.x - rpcgen -l -o $(top_builddir)/rpc/rpcl/$@ $^ + rpcgen -lM -o $(top_builddir)/rpc/rpcl/$@ $^ $(SED) -i 's|TIMEOUT = { 25, 0 }|TIMEOUT = { 300, 0 }|' $(top_builddir)/rpc/rpcl/$@ block_svc.c: block.x - rpcgen -m -o $(top_builddir)/rpc/rpcl/$@ $^ + rpcgen -mM -o $(top_builddir)/rpc/rpcl/$@ $^ dist-hook: find $(distdir) -type f \ |