diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index db1afd37b..f8a84cb26 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -3533,6 +3533,8 @@ glusterd_remove_snap (glusterd_brickinfo_t *brickinfo, const char *mount_pt, glusterd_conf_t *priv = NULL; runner_t runner = {0,}; char msg[1024] = {0, }; + char pidfile[PATH_MAX] = {0, }; + pid_t pid = -1; this = THIS; GF_ASSERT (this); @@ -3557,6 +3559,18 @@ glusterd_remove_snap (glusterd_brickinfo_t *brickinfo, const char *mount_pt, //usleep (24007); //ret = umount2 (mount_pt, MNT_FORCE); + + GLUSTERD_GET_SNAP_BRICK_PIDFILE (pidfile, volname, snapname, brickinfo, + priv); + if (glusterd_is_service_running (pidfile, &pid)) { + ret = kill (pid, SIGKILL); + if (ret && errno != ESRCH) { + gf_log (this->name, GF_LOG_ERROR, "Unable to kill pid " + "%d reason : %s", pid, strerror(errno)); + goto out; + } + } + runinit (&runner); snprintf (msg, sizeof (msg), "umount the snapshot mounted path %s", mount_pt); |