mgmt/glusterd : Fix coverity issue

CID: 727146, 727066

https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85393035&defectInstanceId=26034751&mergedDefectId=727146
https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85392913&defectInstanceId=26034571&mergedDefectId=727066

updates: bz#789278

Change-Id: Ieaef33829ec88e68690dabce4ea21d2e61dad9f6
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
This commit is contained in:
Ashish Pandey 2018-09-10 16:35:25 +05:30 committed by Atin Mukherjee
parent 3114c4a106
commit 23fa1feaf0
2 changed files with 13 additions and 6 deletions

View File

@ -2359,11 +2359,15 @@ glusterfs_rebalance_event_notify (dict_t *dict)
if (dict) {
ret = dict_set_str (dict, "volname", cmd_args->volfile_id);
if (ret)
if (ret) {
gf_log ("", GF_LOG_ERROR, "failed to set volname");
}
ret = dict_allocate_and_serialize (dict, &req.dict.dict_val,
&req.dict.dict_len);
if (ret) {
gf_log ("", GF_LOG_ERROR, "failed to serialize dict");
}
}
ret = mgmt_submit_request (&req, frame, ctx, &clnt_handshake_prog,
@ -2372,7 +2376,6 @@ glusterfs_rebalance_event_notify (dict_t *dict)
(xdrproc_t)xdr_gf_event_notify_req);
GF_FREE (req.dict.dict_val);
return ret;
}

View File

@ -1655,9 +1655,13 @@ brick_graph_add_posix (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
if (ret)
goto out;
if (quota_enabled || pgfid_feat || trash_enabled)
xlator_set_option (xl, "update-link-count-parent",
"on");
if (quota_enabled || pgfid_feat || trash_enabled) {
ret = xlator_set_option (xl, "update-link-count-parent",
"on");
if (ret) {
goto out;
}
}
snprintf (tmpstr, sizeof (tmpstr), "%d", brickinfo->fs_share_count);
ret = xlator_set_option (xl, "shared-brick-count", tmpstr);