cb8e9e
From 1bbdf818b7e7fc04741710613ea1adcb0f26bd31 Mon Sep 17 00:00:00 2001
cb8e9e
From: Soumya Koduri <skoduri@redhat.com>
cb8e9e
Date: Thu, 25 Jun 2015 19:49:59 +0530
cb8e9e
Subject: [PATCH 178/190] protocol/server: Include a check to validate xprt->client
cb8e9e
cb8e9e
rpc_transport entries(xprt) are added to the conf->xprt_list
cb8e9e
during client connection with the server. But the client object is created
cb8e9e
and assigned to that transport object only during GF_HANDSK_SETVOLUME. Hence
cb8e9e
till that period, there could be xprt entries in the xprt_list without client
cb8e9e
associated with it. Added a check to validate the client object during upcall
cb8e9e
notify.
cb8e9e
cb8e9e
This is backport of the fix -
cb8e9e
http://review.gluster.org/#/c/11411/
cb8e9e
cb8e9e
Change-Id: I11e2fcd8b0a67e35302ede478b777b72d1973456
cb8e9e
BUG: 1235544
cb8e9e
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/51718
cb8e9e
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
cb8e9e
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
cb8e9e
---
cb8e9e
 xlators/protocol/server/src/server.c |    4 +++-
cb8e9e
 1 files changed, 3 insertions(+), 1 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
cb8e9e
index ca00dc0..55b3018 100644
cb8e9e
--- a/xlators/protocol/server/src/server.c
cb8e9e
+++ b/xlators/protocol/server/src/server.c
cb8e9e
@@ -1159,7 +1159,9 @@ server_process_event_upcall (xlator_t *this, void *data)
cb8e9e
                 list_for_each_entry (xprt, &conf->xprt_list, list) {
cb8e9e
                         client = xprt->xl_private;
cb8e9e
 
cb8e9e
-                        if (strcmp(client->client_uid, client_uid))
cb8e9e
+                        /* 'client' is not atomically added during xprt entry
cb8e9e
+                         * addition to the list. */
cb8e9e
+                        if (!client || strcmp(client->client_uid, client_uid))
cb8e9e
                                 continue;
cb8e9e
 
cb8e9e
                         rpcsvc_request_submit(conf->rpc, xprt,
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e