mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
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>
This commit is contained in:
parent
43439f6312
commit
48344381d7
@ -395,6 +395,9 @@ ih_open_retry:
|
||||
fdP->fd_fd = INVALID_FD;
|
||||
IH_UNLOCK;
|
||||
OS_CLOSE(closeFd);
|
||||
IH_LOCK;
|
||||
fdInUseCount -= 1;
|
||||
IH_UNLOCK;
|
||||
goto ih_open_retry;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user