summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2015-06-27 11:04:25 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-08-12 23:12:50 -0700
commitf7668938cd7745d024f3d2884e04cd744d0a69ab (patch)
treed93c18c1363ea5579891d5bc40420ef7191b8498 /api
parent546f66f546a9c9f63c4ee7d3f28fc3a494305263 (diff)
rpc: add owner xlator argument to rpc_clnt_new
The @owner argument tells RPC layer the xlator that owns the connection and to which xlator THIS needs be set during network notifications like CONNECT and DISCONNECT. Code paths that originate from the head of a (volume) graph and use STACK_WIND ensure that the RPC local endpoint has the right xlator saved in the frame of the call (callback pair). This guarantees that the callback is executed in the right xlator context. The client handshake process which includes fetching of brick ports from glusterd, setting lk-version on the brick for the session, don't have the correct xlator set in their frames. The problem lies with RPC notifications. It doesn't have the provision to set THIS with the xlator that is registered with the corresponding RPC programs. e.g, RPC_CLNT_CONNECT event received by protocol/client doesn't have THIS set to its xlator. This implies, call(-callbacks) originating from this thread don't have the right xlator set too. The fix would be to save the xlator registered with the RPC connection during rpc_clnt_new. e.g, protocol/client's xlator would be saved with the RPC connection that it 'owns'. RPC notifications such as CONNECT, DISCONNECT, etc inherit THIS from the RPC connection's xlator. Change-Id: I9dea2c35378c511d800ef58f7fa2ea5552f2c409 BUG: 1235582 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/11436 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-internal.h1
-rw-r--r--api/src/glfs-mgmt.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/api/src/glfs-internal.h b/api/src/glfs-internal.h
index ff8ace9cbb8..7e26a48eea5 100644
--- a/api/src/glfs-internal.h
+++ b/api/src/glfs-internal.h
@@ -249,7 +249,6 @@ int glfs_first_lookup (xlator_t *subvol);
void glfs_process_upcall_event (struct glfs *fs, void *data)
GFAPI_PRIVATE(glfs_process_upcall_event, 3.7.0);
-#define DECLARE_OLD_THIS xlator_t *old_THIS = NULL
#define __GLFS_ENTRY_VALIDATE_FS(fs, label) \
do { \
diff --git a/api/src/glfs-mgmt.c b/api/src/glfs-mgmt.c
index d69c3fc1883..48fd618ff68 100644
--- a/api/src/glfs-mgmt.c
+++ b/api/src/glfs-mgmt.c
@@ -863,7 +863,7 @@ glfs_mgmt_init (struct glfs *fs)
if (ret)
goto out;
- rpc = rpc_clnt_new (options, ctx, THIS->name, 8);
+ rpc = rpc_clnt_new (options, THIS, THIS->name, 8);
if (!rpc) {
ret = -1;
gf_msg (THIS->name, GF_LOG_WARNING, 0,