summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorMichael Scherer <misc@redhat.com>2017-02-24 21:35:38 +0100
committerShyamsundar Ranganathan <srangana@redhat.com>2017-02-26 11:35:40 -0500
commit7fcc85748c54687a1a29f25db7155beccba9d186 (patch)
tree85f0995faa41cc41b04f93ba880c39eb67eb418e /xlators
parentd9172b961b85fc2e5431b2970521709680166fe1 (diff)
mgmt: Reset conf_fd to default value to avoid double close
Coverity warn of a path where we use sys_close 2 times on the same file descriptor, which is likely harmless but could cause various hard to debug problems if threads are used (since the file descriptor table is shared among all threads, we could close a newly opened fd by another thread). Change-Id: I0524b31dccc0da94c7b87583e2a88ef06e003518 BUG: 789278 Signed-off-by: Michael Scherer <misc@redhat.com> Reviewed-on: https://review.gluster.org/16758 Tested-by: Michael Scherer <misc@fedoraproject.org> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-quota.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c
index 8685f761ce3..7ce60236a96 100644
--- a/xlators/mgmt/glusterd/src/glusterd-quota.c
+++ b/xlators/mgmt/glusterd/src/glusterd-quota.c
@@ -1065,6 +1065,8 @@ glusterd_store_quota_config (glusterd_volinfo_t *volinfo, char *path,
if (version < 1.2f && conf->op_version >= GD_OP_VERSION_3_7_0) {
/* Upgrade quota.conf file to newer format */
sys_close (conf_fd);
+ conf_fd = -1;
+
ret = glusterd_store_quota_conf_upgrade(volinfo);
if (ret)
goto out;