summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-05-29 15:34:09 +0530
committerNiels de Vos <ndevos@redhat.com>2015-05-30 03:52:11 -0700
commit378fa28f2ed397e71d05b5869026e1e23bab9e96 (patch)
tree02bd90d3aedf5c8a70b1ae8f0a9bfac5e9fda923
parent8772ca6c559623e96bbdd40811d8ec25210810fc (diff)
heal: Do not call glfs_fini in final builds
BUG: 1226253 Change-Id: Id18a7a3a2b9c2cffea6f3d7c8676712fcf9691e5 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/11001 Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--heal/src/glfs-heal.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index cbdb5930cc2..a05b201fcbd 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -674,6 +674,21 @@ out:
return ret;
}
+static void
+cleanup (glfs_t *fs)
+{
+ if (!fs)
+ return;
+#ifdef DEBUG
+ /* glfs fini path is still racy and crashing the program. Since
+ * this program any way has to die, we are not gonna call fini
+ * in the released versions. i.e. final builds. For all
+ * internal testing lets enable this so that glfs_fini code
+ * path becomes stable. */
+ glfs_fini (fs);
+#endif
+}
+
int
main (int argc, char **argv)
{
@@ -818,15 +833,14 @@ main (int argc, char **argv)
loc_wipe (&rootloc);
glfs_subvol_done (fs, top_subvol);
- glfs_fini (fs);
+ cleanup (fs);
return ret;
out:
if (fs && top_subvol)
glfs_subvol_done (fs, top_subvol);
loc_wipe (&rootloc);
- if (fs)
- glfs_fini (fs);
+ cleanup (fs);
return ret;
}