From 7fcc85748c54687a1a29f25db7155beccba9d186 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 24 Feb 2017 21:35:38 +0100 Subject: 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 Reviewed-on: https://review.gluster.org/16758 Tested-by: Michael Scherer Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Shyamsundar Ranganathan --- xlators/mgmt/glusterd/src/glusterd-quota.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xlators/mgmt/glusterd/src') 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; -- cgit