summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2014-06-16 18:56:18 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2014-06-16 19:36:18 -0700
commit84d370774cdbc6847f4f2f64a7f47abb27a7471b (patch)
treec7c7e7a7f77c2ef03aedf47f03163bcc01462666 /xlators/mgmt
parentd3bd3319afb208acfa905696fb0be5545f5883f6 (diff)
glusterd: Use blocking quotad start only on quota enable
Having quotad always being using the blocking runner variant is problematic. In some cases where quotad was started from the epoll thread, it lead to a deadlock which lead to glusterd becoming unresponsive. This patch makes the default quotad_start function use the non-blocking runner_nowait variant. The blocking start is used only when quotad is started on quota enable command. Change-Id: Ib27042748d69ea28e68badcfaddf61589aae4eba BUG: 1109872 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/8082 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-quota.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c20
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.h6
3 files changed, 28 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c
index 3ed0196c15a..3e29a9601bc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-quota.c
+++ b/xlators/mgmt/glusterd/src/glusterd-quota.c
@@ -989,7 +989,8 @@ glusterd_quotad_op (int opcode)
if (glusterd_all_volumes_with_quota_stopped ())
ret = glusterd_quotad_stop ();
else
- ret = glusterd_check_generate_start_quotad ();
+ ret = glusterd_check_generate_start_quotad_wait
+ ();
break;
default:
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 66eb9408a6b..9c6414905c3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -6037,6 +6037,12 @@ glusterd_shd_start ()
int
glusterd_quotad_start ()
{
+ return glusterd_nodesvc_start ("quotad", _gf_false);
+}
+
+int
+glusterd_quotad_start_wait ()
+{
return glusterd_nodesvc_start ("quotad", _gf_true);
}
@@ -6416,6 +6422,20 @@ glusterd_check_generate_start_quotad ()
return ret;
}
+/* Blocking start variant of glusterd_check_generate_start_quotad */
+int
+glusterd_check_generate_start_quotad_wait ()
+{
+ int ret = 0;
+
+ ret = glusterd_check_generate_start_service
+ (glusterd_create_quotad_volfile, glusterd_quotad_stop,
+ glusterd_quotad_start_wait);
+ if (ret == -EINVAL)
+ ret = 0;
+ return ret;
+}
+
int
glusterd_nodesvcs_batch_op (glusterd_volinfo_t *volinfo, int (*nfs_op) (),
int (*shd_op) (), int (*qd_op) ())
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h
index aae91cdff8d..320bc20cdd2 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.h
@@ -223,6 +223,9 @@ int32_t
glusterd_quotad_start ();
int32_t
+glusterd_quotad_start_wait ();
+
+int32_t
glusterd_quotad_stop ();
void
@@ -268,6 +271,9 @@ int
glusterd_check_generate_start_quotad (void);
int
+glusterd_check_generate_start_quotad_wait (void);
+
+int
glusterd_nodesvcs_handle_graph_change (glusterd_volinfo_t *volinfo);
int