From 893f52ec6318ba3083a6bf5c86bb495dc786ee5b Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 1 Aug 2011 17:11:59 +0530 Subject: glusterd rebalance: handle a race condition while starting a rebalance due to the race, there was a possibility of having two (or more) threads doing glusterd_defrag_start(), which would cause different thread to access same pointer, and at some point making it NULL, causing other threads to crash with SEGV. Change-Id: Id05b99dd6f33329027b8a07f1c8da5a65fd6dae9 BUG: 3295 Reviewed-on: http://review.gluster.com/140 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-utils.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 7307f7c47..682e41c86 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2259,8 +2259,7 @@ out: int glusterd_is_defrag_on (glusterd_volinfo_t *volinfo) { - return ((volinfo->defrag_status == GF_DEFRAG_STATUS_LAYOUT_FIX_STARTED) || - (volinfo->defrag_status == GF_DEFRAG_STATUS_MIGRATE_DATA_STARTED)); + return (volinfo->defrag != NULL); } int -- cgit