summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2014-12-19 18:27:14 +0100
committerNiels de Vos <ndevos@redhat.com>2014-12-20 02:20:56 -0800
commit0e78a12381e988a06e1d5a2dd592d132e24a4e10 (patch)
tree9fa41ab9784a4eb2f868efe5dda097f07b14d711
parent72c8b09640976ecf0c2a50dcf92a1b8648e723d4 (diff)
gfapi: always close the fd in glfs_h_creat()
When running stress and performance tests against nfs-ganesha, the number of open file descriptors increases continously. If the tests run long enough, the brick processes will eventually run out of file descriptors. This seems to be caused by glfs_h_creat() which allocates a 'struct glfs_fd', but does not release it. A normal glfs_creat() returns the file descriptor to the application, whereas glfs_h_creat() returns a handle (struct glfs_object). The file descriptor associated with the handle can not be release by glfapi-applications. This fd-leak can be prevented by destroying the 'struct glfs_fd' before returning the 'struct gfls_object' to the gfapi-application. Change-Id: I32465077a35cd0449a8e584c53899b32f022e5af BUG: 1176242 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9318 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--api/src/glfs-handleops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index dadbda3675f..a82cab52dec 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -666,7 +666,7 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- if (ret && glfd) {
+ if (glfd) {
glfs_fd_destroy (glfd);
glfd = NULL;
}