>
> On Mon, 23 Aug 2004, Jeff Moyer wrote:
>
> > Hi Ian, list,
> >
> > We never close the file descriptors we open in the rpc ping path. Here is
> > a patch which addresses this. The patch appears in my latest rpms on my
> > people page.
>
> While I was looking at the problem Bryce reported I got the impression
> that the socket leak patch may not have completely covered the closeing of
> open sockets. I'm probably wrong but I came up with this alternative patch
> which I've called autofs-4.1.3-sock-leak-fix-2.patch.
>
> Any thoughts?
>
> --- autofs-4.1.3/lib/rpc_subs.c.sock-leak-fix-2 2004-09-06 19:26:30.000000000
> +0800
> +++ autofs-4.1.3/lib/rpc_subs.c 2004-09-06 19:41:19.000000000 +0800
> @@ -48,7 +48,7 @@
> */
> static CLIENT* create_udp_client(struct conn_info *info)
> {
> - int fd = -1;
> + int fd = RPC_ANYSOCK;
> CLIENT *client;
> struct sockaddr_in addr;
> struct hostent *hp;
> @@ -179,6 +179,12 @@
> if (!client)
> goto out_close;
>
> + /* Close socket fd on destroy, as is default for rpcowned fds */
> + if (!clnt_control(client, CLSET_FD_CLOSE, NULL)) {
> + clnt_destroy(client);
> + goto out_close;
> + }
> +
> return client;
>
> out_close:
Applied and tried.. (and failed. Same messages about "nfs bindresvport:
Address already in use" in the log file)
One thing of note from an earlier email is that quite a few sockets are left
around from just one mount
[EMAIL PROTECTED] test]# netstat --inet
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.1.40:ssh 192.168.1.100:32985 ESTABLISHED
[EMAIL PROTECTED] test]# ls 1
1
[EMAIL PROTECTED] test]# netstat --inet
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.1.40:855 192.168.1.100:sunrpc TIME_WAIT
tcp 0 0 192.168.1.40:858 192.168.1.100:sunrpc TIME_WAIT
tcp 0 0 192.168.1.40:800 192.168.1.100:nfs ESTABLISHED
tcp 0 0 192.168.1.40:ssh 192.168.1.100:32985 ESTABLISHED
tcp 0 0 192.168.1.40:856 192.168.1.100:1013 TIME_WAIT
so when it comes around to doing an ls * on my setup
[EMAIL PROTECTED] test]# netstat --inet | wc -l
2011
Thats an awful lot of sockets for a meer 200+ mount points
Admittidly the vast majority are in TIME_WAIT states
Unfortunately I can't help beyond just observing results as my knowledge
of RPC extends to just being able to spell it 8/
Phil
=--=
_______________________________________________
autofs mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/autofs