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