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