diff options
author | Sanoj Unnikrishnan <sunnikri@redhat.com> | 2017-03-06 12:36:02 +0530 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-04-05 01:23:25 -0400 |
commit | 6b069086cbee39aec9da77b1831e88fe85258b0f (patch) | |
tree | 0d0a6a4823f04f550127eaff026c11f9d6d68880 /xlators/mgmt | |
parent | 7a49a4a6e3e2224afea7a961fbee9a460b9d58a0 (diff) |
Fixes Stale auxiliary mount when crawler fails to spawn
The auxiliary mount created for crawling remains if the crawler was not
successfully spawned due to transport disconnect or other such issues.
The patch ensures the mount is cleared in those code paths as well.
Change-Id: I659fcc1d1956f8e05a37b75ebe3f3a00c24693e8
BUG: 1429330
Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
Reviewed-on: https://review.gluster.org/16853
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Zhou Zhengping <johnzzpcrystal@gmail.com>
Reviewed-by: Manikandan Selvaganesh <manikandancs333@gmail.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-quota.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c index 7ce60236a96..1e62c9dfdeb 100644 --- a/xlators/mgmt/glusterd/src/glusterd-quota.c +++ b/xlators/mgmt/glusterd/src/glusterd-quota.c @@ -314,6 +314,7 @@ _glusterd_quota_initiate_fs_crawl (glusterd_conf_t *priv, if ((pid = fork ()) < 0) { gf_msg (THIS->name, GF_LOG_WARNING, 0, GD_MSG_FORK_FAIL, "fork from parent failed"); + gf_umount_lazy ("glusterd", mountdir, 1); ret = -1; goto out; } else if (pid == 0) {//first child @@ -321,14 +322,19 @@ _glusterd_quota_initiate_fs_crawl (glusterd_conf_t *priv, * blocking call below */ pid = fork (); - if (pid) - _exit (pid > 0 ? EXIT_SUCCESS : EXIT_FAILURE); + if (pid < 0) { + gf_umount_lazy ("glusterd", mountdir, 1); + _exit (EXIT_FAILURE); + } else if (pid > 0) { + _exit (EXIT_SUCCESS); + } ret = chdir (mountdir); if (ret == -1) { gf_msg (THIS->name, GF_LOG_WARNING, errno, GD_MSG_DIR_OP_FAILED, "chdir %s failed", mountdir); + gf_umount_lazy ("glusterd", mountdir, 1); exit (EXIT_FAILURE); } runinit (&runner); |