[Bugs] [Bug 1233651] pthread cond and mutex variables of fs struct has to be destroyed conditionally.

bugzilla at redhat.com bugzilla at redhat.com
Mon Jun 22 09:36:35 UTC 2015


https://bugzilla.redhat.com/show_bug.cgi?id=1233651



--- Comment #1 from Anand Avati <aavati at redhat.com> ---
COMMIT: http://review.gluster.org/10971 committed in release-3.7 by Niels de
Vos (ndevos at redhat.com) 
------
commit 5afaa6e64f46a32f2b86512236677066adc36510
Author: Humble Devassy Chirammal <hchiramm at redhat.com>
Date:   Mon May 18 17:37:14 2015 +0530

    libgfapi: introduce bit flags for pthread mutex and cond variables

    At present stage, the initialization and destroy of conditional
    and mutex variables of glfs struct happen in different places and
    there is no uniform way of destroying these variables incase
    there is a failure when initializing these. The fs mutex and
    conditional variables are getting destroyed from glfs_free_from_ctx().
    However this destroy is not done by a conditional check inside destroy
    function. By introducing bit flags in glfs object, we can make use of the
    same (if there is a failure in initialization) in glfs_fini()
    which is evolving as one and only function to free fs and ctx resources.
    This patch introduce the flags field and set the flags according
    to the initialization flow of the mutex and conditional variables
    of struct glfs members. Without this patch we are compelled to use
    the goto lables and other hacks in init functions to make sure
    the resources are freed if there is an error path.

    Change-Id: I86e2719fb7ce437419a05699b4f06c14b02d0e69
    BUG: 1233651
    Signed-off-by: Humble Devassy Chirammal <hchiramm at redhat.com>
    Signed-off-by: Poornima G <pgurusid at redhat.com>
    Reviewed-on: http://review.gluster.org/10120
    Reviewed-by: Niels de Vos <ndevos at redhat.com>
    Tested-by: Gluster Build System <jenkins at build.gluster.com>
    Tested-by: NetBSD Build System
    Reviewed-by: Shyamsundar Ranganathan <srangana at redhat.com>
    (cherry picked from commit bc858473db1e1091b15d3f3d69ac6ba5d20b58e7)
    Reviewed-on: http://review.gluster.org/10971
    Tested-by: NetBSD Build System <jenkins at build.gluster.org>
    Reviewed-by: Kaleb KEITHLEY <kkeithle at redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list