From 086f1d088e257a3abce68a1807692c36172a8c0f Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Thu, 1 Feb 2018 16:06:32 +0100 Subject: cluster/afr: remove unnecessary child_up initialization The child_up array was initialized with all elements being -1 to allow afr_notify() to differentiate down bricks from bricks that haven't reported yet. With current implementation this is not needed anymore and it was causing unexpected results when other parts of the code considered that if child_up[i] != 0, it meant that it was up. Backport of: > BUG: 1541038 Change-Id: I2a9d712ee64c512f24bd5cd3a48dcb37e3139472 BUG: 1541930 Signed-off-by: Xavier Hernandez --- xlators/cluster/afr/src/afr.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 84dbcc04680..d3aee77fa5b 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -583,13 +583,6 @@ init (xlator_t *this) goto out; } - for (i = 0; i < child_count; i++) - priv->child_up[i] = -1; /* start with unknown state. - this initialization needed - for afr_notify() to work - reliably - */ - priv->children = GF_CALLOC (sizeof (xlator_t *), child_count, gf_afr_mt_xlator_t); if (!priv->children) { -- cgit