summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2017-11-01 12:14:36 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-11-03 12:00:28 +0000
commit2ef2b600b98d029983bc2eb3b173d0bd201916b4 (patch)
tree0069ab25598181347e24183b5ff8edde7c397adb /xlators/mgmt
parentbf5c5841c443a8da5b8f73c27b2ed83420f2303e (diff)
glusterd/mgmt: coverity fixes
This patch fixes coverity issues 179, 59. Problem: control flow won't enter into if block as volname is always NULL and return value of function synctask_barrier_init is unchecked. Fix: remove condition checking which is always resulting in false, and removing if block which is always unreachable. As a result of removal of condition checking volname became a unused variable, so remove declaration of volname. assign return valur of synctask_barrier_init to ret, if it nonzero value goto out. Change-Id: I870aeb020034e97a761e9314f7ace7573f7c520c BUG: 789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mgmt.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
index 13a4526ebe0..3fb90766082 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mgmt.c
+++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
@@ -687,7 +687,6 @@ glusterd_mgmt_v3_initiate_lockdown (glusterd_op_t op, dict_t *dict,
gf_boolean_t *is_acquired,
uint32_t txn_generation)
{
- char *volname = NULL;
glusterd_peerinfo_t *peerinfo = NULL;
int32_t ret = -1;
int32_t peer_cnt = 0;
@@ -763,15 +762,9 @@ out:
GD_MSG_MGMTV3_LOCK_GET_FAIL, "%s",
*op_errstr);
- if (volname)
- ret = gf_asprintf (op_errstr,
- "Another transaction is in progress "
- "for %s. Please try again after "
- "sometime.", volname);
- else
- ret = gf_asprintf (op_errstr,
- "Another transaction is in progress "
- "Please try again after sometime.");
+ ret = gf_asprintf (op_errstr,
+ "Another transaction is in progress. "
+ "Please try again after sometime.");
if (ret == -1)
*op_errstr = NULL;
@@ -2051,9 +2044,10 @@ glusterd_mgmt_v3_release_peer_locks (glusterd_op_t op, dict_t *dict,
/* Sending mgmt_v3 unlock req to other nodes in the cluster */
gd_syncargs_init (&args, NULL);
- synctask_barrier_init((&args));
+ ret = synctask_barrier_init((&args));
+ if (ret)
+ goto out;
peer_cnt = 0;
-
rcu_read_lock ();
cds_list_for_each_entry_rcu (peerinfo, &conf->peers, uuid_list) {
/* Only send requests to peers who were available before the