summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranand <anekkunt@redhat.com>2015-06-17 16:11:48 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-06-19 02:32:35 -0700
commit8ddf7f2669779cee460f1e008cdb62671cf15a40 (patch)
treefb9596c3cab6cb3c0eb0a021fcb77a8ddb94e778
parent46bf15e897ee9711835af211c19351a9920d490b (diff)
glusterd: Removing sync lock and unlock inside rcu read critical section
Issue : Glsuterd was crashing during peer probe. RCA : In glusterd, we are using big lock which is implemented based on sync task frame work for thread synchronization, sync task frame work swap the threads if there is no worker pool threads available. Due to this rcu lock and rcu unlock was happening in different threads (urcu-bp will not allow this), resulting into glusterd crash. fix : Removing sync lock and unlock inside rcu read critical section, which was left out by http://review.gluster.org/#/c/10285/ patch. Change-Id: Id358dfcc797335bcd3b491c3129017b2caa826eb BUG: 1232693 Signed-off-by: anand <anekkunt@redhat.com> Reviewed-on: http://review.gluster.org/11276 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c28
2 files changed, 5 insertions, 26 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index f777d85f53e..2a0fba23496 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -1622,13 +1622,12 @@ glusterd_rpc_friend_remove (call_frame_t *frame, xlator_t *this,
req.hostname = gf_strdup (peerinfo->hostname);
req.port = peerinfo->port;
- rcu_read_unlock ();
-
ret = glusterd_submit_request (peerinfo->rpc, &req, frame, peerinfo->peer,
GLUSTERD_FRIEND_REMOVE, NULL,
this, glusterd_friend_remove_cbk,
(xdrproc_t)xdr_gd1_mgmt_friend_req);
+ rcu_read_unlock ();
out:
GF_FREE (req.hostname);
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 12cb0730960..48216f61989 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -237,11 +237,10 @@ glusterd_get_uuid (uuid_t *uuid)
}
int
-glusterd_submit_request_unlocked (struct rpc_clnt *rpc, void *req,
- call_frame_t *frame, rpc_clnt_prog_t *prog,
- int procnum, struct iobref *iobref,
- xlator_t *this, fop_cbk_fn_t cbkfn,
- xdrproc_t xdrproc)
+glusterd_submit_request (struct rpc_clnt *rpc, void *req,
+ call_frame_t *frame, rpc_clnt_prog_t *prog,
+ int procnum, struct iobref *iobref,
+ xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc)
{
char new_iobref = 0;
int ret = -1;
@@ -305,25 +304,6 @@ out:
}
-int
-glusterd_submit_request (struct rpc_clnt *rpc, void *req,
- call_frame_t *frame, rpc_clnt_prog_t *prog,
- int procnum, struct iobref *iobref,
- xlator_t *this, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc)
-{
- glusterd_conf_t *priv = THIS->private;
- int ret = -1;
-
- synclock_unlock (&priv->big_lock);
- {
- ret = glusterd_submit_request_unlocked (rpc, req, frame, prog,
- procnum, iobref, this,
- cbkfn, xdrproc);
- }
- synclock_lock (&priv->big_lock);
-
- return ret;
-}
struct iobuf *