]> git.michaelhowe.org Git - packages/o/openafs.git/commit
ihandle: Fix fdInUseCount leak on EMFILE
authorAndrew Deason <adeason@sinenomine.net>
Thu, 30 May 2013 22:40:58 +0000 (17:40 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 24 Sep 2013 12:33:57 +0000 (05:33 -0700)
commit2d1ed3a1108de01ac6a967daf3fc71646703b9f2
treefa2633245f840ac5f3ca7d68362df75e32a082e2
parent0f795f08158ca65242b943ff89525e6901970bec
ihandle: Fix fdInUseCount leak on EMFILE

Here, we close closeFd, but currently we don't decrement fdInUseCount.
Since we retry the open immediately afterwards, this means we can leak
fdInUseCount references. For example, if we retry this 5 times and get
EMFILE on each attempt, we will close 5 FDs, but not decrement
fdInUseCount at all.

To fix this, decrement fdInUseCounter when we close a file for EMFILE.

Reviewed-on: http://gerrit.openafs.org/9967
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 48344381d7a87a3617ec14ffc9f2d9735805ada6)

Change-Id: I03aee981c0b9663ac937c6165796f19366acec1e
Reviewed-on: http://gerrit.openafs.org/10175
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/vol/ihandle.c