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