summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2019-05-22 13:32:23 +0530
committerAtin Mukherjee <amukherj@redhat.com>2019-05-31 03:14:54 +0000
commite9ec61c9fc264c813bb9ed06891e2294870a50bc (patch)
treea9d0b15b0b944daf44ab296b85d2e3f1734a770f /xlators/mgmt/glusterd/src/glusterd-shd-svc.c
parent4f1b762fb482f2ebddaacfd31a7d43a967fea9e3 (diff)
downloadglusterfs-e9ec61c9fc264c813bb9ed06891e2294870a50bc.tar.gz
glusterfs-e9ec61c9fc264c813bb9ed06891e2294870a50bc.tar.xz
glusterfs-e9ec61c9fc264c813bb9ed06891e2294870a50bc.zip
glusterd/svc: glusterd_svcs_stop should call individual wrapper function
glusterd_svcs_stop should call individual wrapper function to stop a daemon rather than calling glusterd_svc_stop. For example for shd, it should call glusterd_shdsvc_stop instead of calling basic API function to stop. Because the individual functions for each daemon could be doing some specific operation in their wrapper function. Change-Id: Ie6d40590251ad470ef3901d1141ab7b22c3498f5 fixes: bz#1712741 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-shd-svc.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-shd-svc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
index 598c082358..ce68a0f07c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
@@ -656,10 +656,18 @@ glusterd_shdsvc_stop(glusterd_svc_t *svc, int sig)
int pid = -1;
conf = THIS->private;
+ GF_VALIDATE_OR_GOTO("glusterd", conf, out);
GF_VALIDATE_OR_GOTO("glusterd", svc, out);
svc_proc = svc->svc_proc;
- GF_VALIDATE_OR_GOTO("glusterd", svc_proc, out);
- GF_VALIDATE_OR_GOTO("glusterd", conf, out);
+ if (!svc_proc) {
+ /*
+ * This can happen when stop was called on a volume that is not shd
+ * compatible.
+ */
+ gf_msg_debug("glusterd", 0, "svc_proc is null, ie shd already stopped");
+ ret = 0;
+ goto out;
+ }
/* Get volinfo->shd from svc object */
shd = cds_list_entry(svc, glusterd_shdsvc_t, svc);