summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]tests/bugs/snapshot/bug-1111041.t6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/bugs/snapshot/bug-1111041.t b/tests/bugs/snapshot/bug-1111041.t
index 9188880912c..f771d64f2a3 100644..100755
--- a/tests/bugs/snapshot/bug-1111041.t
+++ b/tests/bugs/snapshot/bug-1111041.t
@@ -29,4 +29,10 @@ SNAPD_PID=$($CLI volume status $V0 | grep "Snapshot Daemon" | awk {'print $8'});
TEST [ $SNAPD_PID -gt 0 ]
+kill -9 $SNAPD_PID
+
+SNAPD_PID=$($CLI volume status $V0 | grep "Snapshot Daemon" | awk {'print $8'});
+
+TEST [ $SNAPD_PID = 'N/A' ]
+
cleanup ;
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
index 46c8bad1aa9..36adb7fbfd8 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
@@ -2051,6 +2051,8 @@ glusterd_add_snapd_to_dict (glusterd_volinfo_t *volinfo,
glusterd_svc_build_snapd_pidfile (volinfo, pidfile, sizeof (pidfile));
brick_online = gf_is_service_running (pidfile, &pid);
+ if (brick_online == _gf_false)
+ pid = -1;
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.pid", base_key);