From c9338497aa163a54c32c70869a0035aa875312cc Mon Sep 17 00:00:00 2001 From: Anuradha Date: Fri, 5 Jun 2015 16:49:14 +0530 Subject: [PATCH 250/279] heal : Do not invoke glfs_fini for glfs-heal commands backport of http://review.gluster.org/11001 & http://review.gluster.org/11115 Change-Id: I2fa6789488c4ecebbed049f46c189441fba48535 BUG: 1236990 Signed-off-by: Anuradha Reviewed-on: http://review.gluster.org/11103 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur Reviewed-on: http://review.gluster.org/11115 Tested-by: NetBSD Build System Signed-off-by: Anuradha Talur Reviewed-on: https://code.engineering.redhat.com/gerrit/51934 Reviewed-by: Ravishankar Narayanankutty Tested-by: Ravishankar Narayanankutty --- heal/src/glfs-heal.c | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c index cbdb593..bc76518 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; +#if 0 + /* 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; } -- 1.7.1