diff options
author | Ashish Pandey <aspandey@redhat.com> | 2018-09-10 16:35:25 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2018-09-11 02:32:47 +0000 |
commit | 23fa1feaf0a3ab482628ab5b7b950d27e57fb46d (patch) | |
tree | 9836fa4a682cede6156f60087d7deb4a5f591ecc | |
parent | 3114c4a10672a70c8964c8cfce2ca0cc1e835a9f (diff) |
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>
-rw-r--r-- | glusterfsd/src/glusterfsd-mgmt.c | 9 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 10 |
2 files changed, 13 insertions, 6 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 8b25f3a1525..f7b1f367f97 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -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; } diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 33e6dc064bd..3e56eb36508 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -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); |