diff options
author | Subha sree Mohankumar <smohanku@redhat.com> | 2017-09-25 14:58:13 +0530 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-10-05 18:16:07 +0000 |
commit | deea16e59564575d5f211f4fb8e4e5597e570ad1 (patch) | |
tree | a83ec9061bbf0d260624a4c8f4fa2ad90cb1d88d /xlators/cluster/afr/src/afr-common.c | |
parent | 601b6547f2c53651b88a0560a41d702db06c0d1c (diff) |
xlator/cluster/afr:coverity Issue "UNUSED_VALUE" in afr_get_split_brain_status
Issue: Event value_overwrite:Overwriting previous write to "ret"
with value "-1".
Fix : An "If" condition is added to check the value of "ret".
Change-Id: I7b6bd4f20f73fa85eb8a5169644e275c7b56af51
BUG: 789278
Signed-off-by: Subha sree Mohankumar <smohanku@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 9d85310bb75..01357fe2e08 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -6051,9 +6051,15 @@ afr_get_split_brain_status (void *opaque) &m_spb); if (ret) { op_errno = -ret; - if (ret == -EAGAIN) + if (ret == -EAGAIN) { ret = dict_set_str (dict, GF_AFR_SBRAIN_STATUS, SBRAIN_HEAL_NO_GO_MSG); + if (ret) { + gf_msg (this->name, GF_LOG_WARNING, + -ret, AFR_MSG_DICT_SET_FAILED, + "Failed to set GF_AFR_SBRAIN_STATUS in dict"); + } + } ret = -1; goto out; } |