From deea16e59564575d5f211f4fb8e4e5597e570ad1 Mon Sep 17 00:00:00 2001 From: Subha sree Mohankumar Date: Mon, 25 Sep 2017 14:58:13 +0530 Subject: 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 --- xlators/cluster/afr/src/afr-common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xlators') 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; } -- cgit