diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-shd-svc.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-shd-svc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c index 2edc2738954..598c0823586 100644 --- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c +++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c @@ -254,14 +254,26 @@ glusterd_shdsvc_manager(glusterd_svc_t *svc, void *data, int flags) { int ret = -1; glusterd_volinfo_t *volinfo = NULL; + glusterd_conf_t *conf = NULL; + gf_boolean_t shd_restart = _gf_false; + conf = THIS->private; volinfo = data; + GF_VALIDATE_OR_GOTO("glusterd", conf, out); GF_VALIDATE_OR_GOTO("glusterd", svc, out); GF_VALIDATE_OR_GOTO("glusterd", volinfo, out); if (volinfo) glusterd_volinfo_ref(volinfo); + while (conf->restart_shd) { + synclock_unlock(&conf->big_lock); + sleep(2); + synclock_lock(&conf->big_lock); + } + conf->restart_shd = _gf_true; + shd_restart = _gf_true; + ret = glusterd_shdsvc_create_volfile(volinfo); if (ret) goto out; @@ -310,6 +322,8 @@ glusterd_shdsvc_manager(glusterd_svc_t *svc, void *data, int flags) } } out: + if (shd_restart) + conf->restart_shd = _gf_false; if (volinfo) glusterd_volinfo_unref(volinfo); if (ret) |