ihandle: Fix fdInUseCount leak on EMFILE
authorAndrew Deason <adeason@sinenomine.net>
Thu, 30 May 2013 22:40:58 +0000 (17:40 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Thu, 20 Jun 2013 12:20:31 +0000 (05:20 -0700)
commit48344381d7a87a3617ec14ffc9f2d9735805ada6
treec2b3a5bfbe3860c9e01725b6067df1ade44090c2
parent43439f6312bc8f631d3eb1e28282730aac47b0eb
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.

Change-Id: I347e37a8d670a6dde7e1d24eeb893c145d9e34e5
Reviewed-on: http://gerrit.openafs.org/9967
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
src/vol/ihandle.c