Bug 183131 - mount leaks socket descriptors under some conditions
Summary: mount leaks socket descriptors under some conditions
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: util-linux
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Steve Dickson
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks: 170416
TreeView+ depends on / blocked
 
Reported: 2006-02-26 18:55 UTC by Neil Horman
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-28 15:57:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Neil Horman 2006-02-26 18:55:48 UTC
+++ This bug was initially created as a clone of Bug #183130 +++

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:
always

Steps to Reproduce:
1.add ~600 nfs mounts to /etc/fstab
2.issue a service netfs start
3.
  
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.

-- Additional comment from nhorman on 2006-02-26 13:52 EST --
Created an attachment (id=125282)
patch to correct mount socket leak


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