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)
REVIEW: http://review.gluster.org/14800 (libglusterfs: race condition when set ctx->timer in function gf_timer_registry_init) posted (#1) for review on master by Zhou Zhengping (johnzzpcrystal)
COMMIT: http://review.gluster.org/14800 committed in master by Jeff Darcy (jdarcy) ------ commit 693eccd456c4fc7dfadb72069da906544cf19733 Author: Zhou Zhengping <johnzzpcrystal> Date: Sun Jun 26 19:56:58 2016 -0400 libglusterfs: race condition when set ctx->timer in function gf_timer_registry_init 1.fix race conditon when set ctx->timer 2.use typical list_head operation instead of verbose list's operation 3.add file "tags" into .gitignore Signed-off-by: Zhou Zhengping <johnzzpcrystal> Change-Id: I4ec55e41356633cf1399536d202c58e19b309f00 BUG: 1350191 Reviewed-on: http://review.gluster.org/14800 Smoke: Gluster Build System <jenkins.org> Tested-by: Zhou Zhengping <johnzzpcrystal> CentOS-regression: Gluster Build System <jenkins.org> NetBSD-regression: NetBSD Build System <jenkins.org> Reviewed-by: Jeff Darcy <jdarcy>