From 378fa28f2ed397e71d05b5869026e1e23bab9e96 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 BUG: 1226253 Change-Id: Id18a7a3a2b9c2cffea6f3d7c8676712fcf9691e5 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/11001 Reviewed-by: Ravishankar N Reviewed-by: Niels de Vos Tested-by: Gluster Build System --- 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