diff options
author | Amar Tumballi <amar@gluster.com> | 2011-08-01 17:11:59 +0530 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-08-03 22:23:53 -0700 |
commit | 03aa9ecde933269282ca1043a16378e0d1e5cb49 (patch) | |
tree | 9d99ab6f0594a7e480660e6f89011d98b16dd071 | |
parent | 5bd8f537da3fe570e481713a1c2c4ee6e88ac38e (diff) |
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/138
Reviewed-by: Anand Avati <avati@gluster.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 137d38017..8eee88935 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2764,8 +2764,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 |