Skip to content

Commit

Permalink
DAOS-7239 coverity: various fixes in placement (#5463)
Browse files Browse the repository at this point in the history
Various fixes in placement.

Signed-off-by: Di Wang <di.wang@intel.com>
  • Loading branch information
wangdi authored Apr 16, 2021
1 parent 93add90 commit 9cd8679
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/placement/jump_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,11 @@ get_object_layout(struct pl_jump_map *jmap, struct pl_obj_layout *layout,
}
rc = 0;

if (out_list != NULL) {
D_INIT_LIST_HEAD(&local_list);
if (out_list != NULL)
remap_list = out_list;
} else {
D_INIT_LIST_HEAD(&local_list);
else
remap_list = &local_list;
}

dom_size = (struct pool_domain *)(root->do_targets) - (root) + 1;
D_ALLOC_ARRAY(dom_used, (dom_size / NBBY) + 1);
Expand Down
7 changes: 3 additions & 4 deletions src/placement/ring_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,15 +1091,13 @@ ring_obj_layout_fill(struct pl_map *map, struct daos_obj_md *md,
}

rc = ring_obj_remap_shards(rimap, md, layout, rop, remap_list,
for_reint);
for_reint);

if (rc == 0)
obj_layout_dump(md->omd_id, layout);
out:
if (rc) {
if (rc)
D_ERROR("ring_obj_layout_fill failed, rc "DF_RC"\n", DP_RC(rc));
remap_list_free_all(remap_list);
}
return rc;
}

Expand Down Expand Up @@ -1134,6 +1132,7 @@ ring_obj_place(struct pl_map *map, struct daos_obj_md *md,
if (rc) {
D_ERROR("ring_obj_layout_fill failed, rc "DF_RC"\n", DP_RC(rc));
pl_obj_layout_free(layout);
remap_list_free_all(&remap_list);
return rc;
}

Expand Down
1 change: 1 addition & 0 deletions src/placement/tests/placement_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ int main(int argc, char *argv[])
cmocka_set_test_filter(filter);
}
#else
sprintf(filter, "*%s*", optarg);
D_PRINT("filter not enabled. %s not applied", filter);
#endif
break;
Expand Down

0 comments on commit 9cd8679

Please sign in to comment.