summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2019-04-25 12:00:52 +0530
committerAtin Mukherjee <amukherj@redhat.com>2019-05-02 13:36:06 +0530
commit91c19c50a3c7b336177dda186500568be43626b8 (patch)
tree23e98195583ecd3e989f11792f86f0433bf18e85 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent60d6e90bd0565f8d56641ff97dd90348894ac870 (diff)
glusterd: Fix coverity defects & put coverity annotations
Along with fixing few defect, put the required annotations for the defects which are marked ignore/false positive/intentional as per the coverity defect sheet. This should avoid the per component graph showing many defects as open in the coverity glusterfs web page. Updates: bz#789278 Change-Id: I19461dc3603a3bd8f88866a1ab3db43d783af8e4 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 4a2caa34f78..7ec8a4cf1ce 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -903,6 +903,7 @@ glusterd_create_sub_tier_volinfo(glusterd_volinfo_t *volinfo,
(*dup_volinfo)->brick_count = tier_info->cold_brick_count;
}
out:
+ /* coverity[REVERSE_NULL] */
if (ret && *dup_volinfo) {
glusterd_volinfo_delete(*dup_volinfo);
*dup_volinfo = NULL;
@@ -2662,6 +2663,7 @@ glusterd_readin_file(const char *filepath, int *line_count)
/* Reduce allocation to minimal size. */
p = GF_REALLOC(lines, (counter + 1) * sizeof(char *));
if (!p) {
+ /* coverity[TAINTED_SCALAR] */
free_lines(lines, counter);
lines = NULL;
goto out;
@@ -6573,6 +6575,7 @@ glusterd_restart_bricks(void *opaque)
if (!brickinfo->start_triggered) {
pthread_mutex_lock(&brickinfo->restart_mutex);
{
+ /* coverity[SLEEP] */
glusterd_brick_start(volinfo, brickinfo, _gf_false,
_gf_false);
}
@@ -8682,7 +8685,7 @@ glusterd_nfs_statedump(char *options, int option_cnt, char **op_errstr)
kill(pid, SIGUSR1);
sleep(1);
-
+ /* coverity[TAINTED_STRING] */
sys_unlink(dumpoptions_path);
ret = 0;
out:
@@ -8814,6 +8817,7 @@ glusterd_quotad_statedump(char *options, int option_cnt, char **op_errstr)
sleep(1);
+ /* coverity[TAINTED_STRING] */
sys_unlink(dumpoptions_path);
ret = 0;
out:
@@ -13206,7 +13210,7 @@ glusterd_get_global_options_for_all_vols(rpcsvc_request_t *req, dict_t *ctx,
if (key_fixed)
key = key_fixed;
}
-
+ /* coverity[CONSTANT_EXPRESSION_RESULT] */
ALL_VOLUME_OPTION_CHECK("all", _gf_true, key, ret, op_errstr, out);
for (i = 0; valid_all_vol_opts[i].option; i++) {
@@ -13904,6 +13908,7 @@ glusterd_disallow_op_for_tier(glusterd_volinfo_t *volinfo, glusterd_op_t op,
break;
case GD_OP_REMOVE_BRICK:
switch (cmd) {
+ /* coverity[MIXED_ENUMS] */
case GF_DEFRAG_CMD_DETACH_START:
case GF_OP_CMD_DETACH_COMMIT_FORCE:
case GF_OP_CMD_DETACH_COMMIT: