From 277008a3a8583ef10cec9e4182960792e56c5c10 Mon Sep 17 00:00:00 2001 From: Rajesh Joseph Date: Mon, 14 Nov 2016 15:40:32 +0530 Subject: libglusterfs:Now mempool is added to ctx pool list under a lock mempool is added to ctx pool list without any lock. This can cause undefined behaviour in case of multithreaded environment. Fix: modify the list only under ctx->lock Change-Id: I7bdbb3db48a899bb0e41427e149b13c0facaedba Signed-off-by: Rajesh Joseph BUG: 1394719 Reviewed-on: http://review.gluster.org/15842 NetBSD-regression: NetBSD Build System Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra Talur Reviewed-by: Shyamsundar Ranganathan Reviewed-by: Poornima G Reviewed-by: Niels de Vos --- api/src/glfs.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'api') diff --git a/api/src/glfs.c b/api/src/glfs.c index 8410504059a..418c6c5d285 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -149,8 +149,6 @@ glusterfs_ctx_defaults_init (glusterfs_ctx_t *ctx) LOCK_INIT (&pool->lock); ctx->pool = pool; - LOCK_INIT (&ctx->lock); - ret = 0; err: if (ret && pool) { -- cgit