From: minoura@valinux.co.jp (Minoura Makoto) Subject: [PATCH] fix for bad TCP reclen Date: Wed, 10 Apr 2002 14:52:02 +0900 Sender: nfs-admin@lists.sourceforge.net Message-ID: <20020410055202.7DD3F19F26B@brer.local.valinux.co.jp> Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from gw1.valinux.co.jp ([202.221.173.98] helo=brer.local.valinux.co.jp) by usw-sf-list1.sourceforge.net with esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id 16vB1e-0000MM-00 for ; Tue, 09 Apr 2002 22:52:10 -0700 To: nfs@lists.sourceforge.net Errors-To: nfs-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Id: Discussion of NFS under Linux development, interoperability, and testing. List-Unsubscribe: , List-Archive: The attached patch for linux-2.5.7 fixes the bug in kNFSd that it ignores short read/EAGAIN while reading the RPC over TCP recordmarks. It sometimes fell into "bad TCP reclen 0x????????" storm, especially in some abnormal conditions (server reboots etc). -- MINOURA Makoto Engineering Dept., VA Linux Systems Japan --- net/sunrpc/svcsock.c.orig Tue Mar 19 05:37:05 2002 +++ net/sunrpc/svcsock.c Fri Mar 29 17:47:24 2002 @@ -781,10 +781,18 @@ unsigned long want = 4 - svsk->sk_tcplen; struct iovec iov; + len = svc_recv_available(svsk); + if (len == -EAGAIN || (len >= 0 && len < want)) { + dprintk("short TCP recmark read %d\n", svsk->sk_tcplen); + goto error; + } + iov.iov_base = ((char *) &svsk->sk_reclen) + svsk->sk_tcplen; iov.iov_len = want; - if ((len = svc_recvfrom(rqstp, &iov, 1, want)) < 0) + len = svc_recvfrom(rqstp, &iov, 1, want); + if (len < 0) goto error; + svsk->sk_tcplen += len; svsk->sk_reclen = ntohl(svsk->sk_reclen); _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs