From 513775e173412f75113d4e238884417aecae5ea3 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 29 May 2015 15:34:09 +0530 Subject: heal: Do not call glfs_fini in final builds Backport of http://review.gluster.org/11001 BUG: 1226272 Change-Id: I213a2855ab44a19e0b5cd36bb0ac180015b8a21f Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/11048 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Niels de Vos --- heal/src/glfs-heal.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'heal') 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; } -- cgit