diff options
author | Susant Palai <spalai@redhat.com> | 2014-01-06 12:38:08 +0000 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-01-20 04:23:18 -0800 |
commit | b2ef4e3d11af79a765406672bb6ca070b40c9b64 (patch) | |
tree | d74dafde3d6b18d0c282dab7e96a952223c7ea59 /xlators/mgmt | |
parent | 8d55c25f158921b508bff0e7f25158991913f922 (diff) |
quota: unmount quota aux mount for volume stop
Previously df -h used to display "Transport end point not connected"
for quota auxiliary mount after volume is stopped. This patch
unmounts the auxiliary mount when the volume is stopped in all peer
nodes for that volume.
Change-Id: I78abb44386cd8242a532f92c13df8bdb57c78e31
BUG: 1049323
Signed-off-by: Susant Palai <spalai@redhat.com>
Reviewed-on: http://review.gluster.org/6656
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index 85a53730602..051e7d7569e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -1774,6 +1774,9 @@ glusterd_op_stop_volume (dict_t *dict) glusterd_volinfo_t *volinfo = NULL; glusterd_brickinfo_t *brickinfo = NULL; xlator_t *this = NULL; + char mountdir[PATH_MAX] = {0,}; + runner_t runner = {0,}; + char pidfile[PATH_MAX] = {0,}; this = THIS; GF_ASSERT (this); @@ -1801,6 +1804,30 @@ glusterd_op_stop_volume (dict_t *dict) if (ret) goto out; + /* If quota auxiliary mount is present, unmount it */ + GLUSTERFS_GET_AUX_MOUNT_PIDFILE (pidfile, volname); + + if (!gf_is_service_running (pidfile, NULL)) { + gf_log (this->name, GF_LOG_DEBUG, "Aux mount of volume %s " + "absent", volname); + } else { + GLUSTERD_GET_QUOTA_AUX_MOUNT_PATH (mountdir, volname, "/"); + + runinit (&runner); + runner_add_args (&runner, "umount", + + #if GF_LINUX_HOST_OS + "-l", + #endif + mountdir, NULL); + ret = runner_run_reuse (&runner); + if (ret) + gf_log (this->name, GF_LOG_ERROR, "umount on %s failed, " + "reason : %s", mountdir, strerror (errno)); + + runner_end (&runner); + } + ret = glusterd_nodesvcs_handle_graph_change (volinfo); out: return ret; |