diff options
author | anand <anekkunt@redhat.com> | 2015-04-17 14:19:46 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-04-30 04:47:46 -0700 |
commit | 7bafeda4641582b5254f0e1f49e853dd87fe93f5 (patch) | |
tree | fd2422e96946abe872ec4bd142d47f031eae5faf /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | e204133875eab538261aa91bb6865bec29c6dbbc (diff) |
libglusterfs: Implementation of sync lock as recursive lock to avoid crash.
Problem : In glusterd,we are using big lock which is implemented based on sync
task frame work for thread synchronization and rcu lock for data consistency.
sync task frame work swap the threads if there is no worker poll 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 : To avoid releasing the sync lock(big lock) in between rcu critical
section,implemented sync lock as recursive lock.
More details:
link : http://www.spinics.net/lists/gluster-devel/msg14632.html
Change-Id: I2b56c1caf3f0470f219b1adcaf62cce29cdc6b88
BUG: 1216942
Signed-off-by: anand <anekkunt@redhat.com>
Reviewed-on: http://review.gluster.org/10285
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
(cherry picked from commit ada6b3a8800867934af57a57d5312f5a5d8374f0)
Reviewed-on: http://review.gluster.org/10432
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 9d2ce35a193..e4cea90545e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2730,6 +2730,7 @@ glusterd_spawn_daemons (void *opaque) gf_boolean_t start_bricks = !conf->restart_done; int ret = -1; + synclock_lock (&conf->big_lock); if (start_bricks) { glusterd_restart_bricks (conf); conf->restart_done = _gf_true; @@ -9085,7 +9086,8 @@ glusterd_launch_synctask (synctask_fn_t fn, void *opaque) this = THIS; priv = this->private; - synclock_lock (&priv->big_lock); + /* synclock_lock must be called from within synctask, @fn must call it before + * it starts with its work*/ ret = synctask_new (this->ctx->env, fn, gd_default_synctask_cbk, NULL, opaque); if (ret) |