233933
From 066189add979d2e4c74463592e5021bd060d5a51 Mon Sep 17 00:00:00 2001
233933
From: Mohammed Rafi KC <rkavunga@redhat.com>
233933
Date: Thu, 11 Jul 2019 12:46:47 +0530
233933
Subject: [PATCH 241/255] Revert "glusterd/svc: glusterd_svcs_stop should call
233933
 individual wrapper function"
233933
233933
This reverts commit 79fff98f9ca5f815cf0227312b9a997d555dad29.
233933
233933
BUG: 1471742
233933
Change-Id: I258040ed9be6bc3b4498c76ed51d59258c55acff
233933
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/175950
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
233933
---
233933
 xlators/mgmt/glusterd/src/glusterd-shd-svc.c    | 12 ++----------
233933
 xlators/mgmt/glusterd/src/glusterd-svc-helper.c | 10 +++++-----
233933
 2 files changed, 7 insertions(+), 15 deletions(-)
233933
233933
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
233933
index 981cc87..75f9a07 100644
233933
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
233933
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
233933
@@ -656,18 +656,10 @@ glusterd_shdsvc_stop(glusterd_svc_t *svc, int sig)
233933
     int pid = -1;
233933
 
233933
     conf = THIS->private;
233933
-    GF_VALIDATE_OR_GOTO("glusterd", conf, out);
233933
     GF_VALIDATE_OR_GOTO("glusterd", svc, out);
233933
     svc_proc = svc->svc_proc;
233933
-    if (!svc_proc) {
233933
-        /*
233933
-         * This can happen when stop was called on a volume that is not shd
233933
-         * compatible.
233933
-         */
233933
-        gf_msg_debug("glusterd", 0, "svc_proc is null, ie shd already stopped");
233933
-        ret = 0;
233933
-        goto out;
233933
-    }
233933
+    GF_VALIDATE_OR_GOTO("glusterd", svc_proc, out);
233933
+    GF_VALIDATE_OR_GOTO("glusterd", conf, out);
233933
 
233933
     /* Get volinfo->shd from svc object */
233933
     shd = cds_list_entry(svc, glusterd_shdsvc_t, svc);
233933
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
233933
index 6a3ca52..f7be394 100644
233933
--- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
233933
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
233933
@@ -86,25 +86,25 @@ glusterd_svcs_stop(glusterd_volinfo_t *volinfo)
233933
     priv = this->private;
233933
     GF_ASSERT(priv);
233933
 
233933
-    ret = priv->nfs_svc.stop(&(priv->nfs_svc), SIGKILL);
233933
+    ret = glusterd_svc_stop(&(priv->nfs_svc), SIGKILL);
233933
     if (ret)
233933
         goto out;
233933
 
233933
-    ret = priv->quotad_svc.stop(&(priv->quotad_svc), SIGTERM);
233933
+    ret = glusterd_svc_stop(&(priv->quotad_svc), SIGTERM);
233933
     if (ret)
233933
         goto out;
233933
 
233933
     if (volinfo) {
233933
-        ret = volinfo->shd.svc.stop(&(volinfo->shd.svc), SIGTERM);
233933
+        ret = glusterd_svc_stop(&(volinfo->shd.svc), PROC_START_NO_WAIT);
233933
         if (ret)
233933
             goto out;
233933
     }
233933
 
233933
-    ret = priv->bitd_svc.stop(&(priv->bitd_svc), SIGTERM);
233933
+    ret = glusterd_svc_stop(&(priv->bitd_svc), SIGTERM);
233933
     if (ret)
233933
         goto out;
233933
 
233933
-    ret = priv->scrub_svc.stop(&(priv->scrub_svc), SIGTERM);
233933
+    ret = glusterd_svc_stop(&(priv->scrub_svc), SIGTERM);
233933
 out:
233933
     return ret;
233933
 }
233933
-- 
233933
1.8.3.1
233933