This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 183130 - mount leaks socket descriptors under some conditions
mount leaks socket descriptors under some conditions
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: util-linux (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Steve Dickson
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2006-02-26 13:52 EST by Neil Horman
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-28 10:27:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch to correct mount socket leak (1.04 KB, patch)
2006-02-26 13:52 EST, Neil Horman
no flags Details | Diff

  None (edit)
Description Neil Horman 2006-02-26 13:52:12 EST
Description of problem:
if try_mount_one function in the mount utility follows the retry_nfs goto
(usually occuring because of a local mount error following a successful contact
of the nfs server, the mount utility will leak socket descriptors.  This is due
to the fact that nfsmount records the socket that is bound and connected to an
nfs server in a static data structure which gets overwritten without being first
closed on repetative calls to nfsmount through the retry_nfs path in try_mount_one.

Version-Release number of selected component (if applicable):
2.11y and forward

How reproducible:

Steps to Reproduce:
1.add ~600 nfs mounts to /etc/fstab
2.issue a service netfs start
Actual results:
not all mounts are mounted.  mounts begin failing eventually with EADDRINUSE

Expected results:
all mounts successful.

Additional info:
I've written the attached patch to correct this problem by initalizing the
static data in nfsmount() and checking it on each entry to the function.  If it
is greater than zero it is closed before attempting to open a new socket. 
Tested by myself and the reporter with successful results.
Comment 1 Neil Horman 2006-02-26 13:52:13 EST
Created attachment 125282 [details]
patch to correct mount socket leak

Note You need to log in before you can comment on or make changes to this bug.