From 0e78a12381e988a06e1d5a2dd592d132e24a4e10 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 19 Dec 2014 18:27:14 +0100 Subject: 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 Reviewed-on: http://review.gluster.org/9318 Reviewed-by: Kaleb KEITHLEY Reviewed-by: Shyamsundar Ranganathan Tested-by: Gluster Build System --- api/src/glfs-handleops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit