[Bugs] [Bug 1350191] New: race condition when set ctx-> timer in function gf_timer_registry_init

bugzilla at redhat.com bugzilla at redhat.com
Sun Jun 26 11:39:55 UTC 2016


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

            Bug ID: 1350191
           Summary: race condition when set ctx->timer in function
                    gf_timer_registry_init
           Product: GlusterFS
           Version: mainline
         Component: core
          Severity: medium
          Assignee: bugs at gluster.org
          Reporter: johnzzpcrystal at gmail.com
                CC: bugs at gluster.org



Description of problem:
race condition when set ctx->timer in function gf_timer_registry_init,

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
the orginal logic is 
LOCK(&ctx->lock)
reg = ctx->timer;
UNLOCK
if (!reg)
     LOCK(&ctx->lock)
          ctx->timer = new_reg;
     UNLOCK

the right logic is 
LOCK(&ctx->lock)
if (!ctx->timer)
    ctx->timer = new_reg;
UNLOCK(&ctx->lock)

-- 
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