From owner-cvs-src-old@FreeBSD.ORG Tue Feb 8 21:05:23 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C3131065695 for ; Tue, 8 Feb 2011 21:05:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 69C538FC1E for ; Tue, 8 Feb 2011 21:05:23 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p18L5NPl087492 for ; Tue, 8 Feb 2011 21:05:23 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p18L5NvG087491 for cvs-src-old@freebsd.org; Tue, 8 Feb 2011 21:05:23 GMT (envelope-from jhb@repoman.freebsd.org) Message-Id: <201102082105.p18L5NvG087491@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jhb@repoman.freebsd.org using -f From: John Baldwin Date: Tue, 8 Feb 2011 21:05:07 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/sys/nfsserver nfs_syscalls.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2011 21:05:23 -0000 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