From owner-freebsd-bugs Fri Apr 18 03:02:54 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id DAA22209 for bugs-outgoing; Fri, 18 Apr 1997 03:02:54 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id CAA22114 for ; Fri, 18 Apr 1997 02:58:21 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id LAA08276; Fri, 18 Apr 1997 11:11:30 +0200 From: Luigi Rizzo Message-Id: <199704180911.LAA08276@labinfo.iet.unipi.it> Subject: Re: kern/3304: NFS V2 readdir hangs To: ponds!rivers@dg-rtp.dg.com Date: Fri, 18 Apr 1997 11:11:30 +0200 (MET DST) Cc: freebsd-bugs@freefall.freebsd.org In-Reply-To: <199704180230.TAA25674@freefall.freebsd.org> from "Thomas David Rivers" at Apr 17, 97 07:29:45 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Hi, I followed the interesting (and very detailed) analysis of the NFS problem (PR kern/3304), and I have a possible patch. looking at nfs_rcvlock() is implemented, I notice that the only way to return EALREADY is to have rep->r_mrep != NULL The variable comes (via nfs_reply() ) from nfs_request() where the code is something like the following (I have reported only a few relevant lines, from a 2.2.1-R system: $Id: nfs_socket.c,v 1.18 1996/10/11 10:15:33 dfr Exp $ 923: tryagain: ... 933: rep->r_mrep = NULL; ... 979: error = nfs_reply(rep); ... 1064: goto tryagain; the problem is, r_mrep seems only to be set to something != NULL in nfs_reply(). While I don't understand the code very well, it seems to me that the initialization in line 933 should be moved outside the retry loop, before line 923. Otherwise the locking cannot possibly work because repeated calls to nfs_reply() use the same parameters. Can someone (Dave ?) try the above fix and see if it works ? Thanks Luigi -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________