Date: Tue, 8 Feb 2011 21:05:07 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/nfsserver nfs_syscalls.c Message-ID: <201102082105.p18L5NvG087491@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
jhb 2011-02-08 21:05:07 UTC
FreeBSD src repository
Modified files: (Branch: RELENG_7)
sys/nfsserver nfs_syscalls.c
Log:
SVN rev 218456 on 2011-02-08 21:05:07Z by jhb
Properly close a socket for a TCP NFS client if the NFS server notices that
the client has disconnected while attempting to fetch a request. This
accidentally works most of the time because the socket upcall is invoked
twice for some reason causing two nfsd threads to be assigned to the
same connection. The first thread notices the disconnect when soreceive()
fails, and the second thread will then cleanup the connection. Occasionally
the second thread will grab the NFSD lock before the first thread has
returned from soreceive() to mark the connection as disconnected. When that
happens, the socket is never cleaned up and is leaked.
Fix this by checking for the disconnect flag if there is an error pulling a
request from the connection and closing the socket if it nfsrv_rcv() marked
the connection as disconnected. Now the first thread will close the socket
in most cases and the socket is never leaked.
This is a direct commit to 7 as it is specific to the pre-krpc code used
in 7.
Revision Changes Path
1.116.2.3 +2 -0 src/sys/nfsserver/nfs_syscalls.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102082105.p18L5NvG087491>
