diff options
| author | Pranith Kumar K <pkarampu@redhat.com> | 2015-05-29 15:34:09 +0530 | 
|---|---|---|
| committer | Niels de Vos <ndevos@redhat.com> | 2015-06-04 05:55:29 -0700 | 
| commit | 513775e173412f75113d4e238884417aecae5ea3 (patch) | |
| tree | 9774b46bbba5c6a9be1e76662a8911fb622a04c1 | |
| parent | 3e8f9c1da61bf70ed635a655e966df574d1e15cd (diff) | |
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 <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11048
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
| -rw-r--r-- | 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 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;  }  | 
