From owner-freebsd-current@FreeBSD.ORG Tue May 13 00:26:01 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5620937B401; Tue, 13 May 2003 00:26:01 -0700 (PDT) Received: from bluejay.mail.pas.earthlink.net (bluejay.mail.pas.earthlink.net [207.217.120.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id B016443FA3; Tue, 13 May 2003 00:26:00 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0694.cvx21-bradley.dialup.earthlink.net ([209.179.194.184] helo=mindspring.com) by bluejay.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19FUAf-0004tC-00; Tue, 13 May 2003 00:25:58 -0700 Message-ID: <3EC09D37.2BA4078B@mindspring.com> Date: Tue, 13 May 2003 00:22:31 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Don Lewis References: <200305130701.h4D70xM7049478@gw.catspoiler.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a43618f585620fa4218ba979f6f216defaa7ce0e8f8d31aa3f350badd9bab72f9c350badd9bab72f9c cc: alfred@FreeBSD.org cc: rwatson@FreeBSD.org cc: current@FreeBSD.org Subject: Re: rpc.lockd spinning; much breakage X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2003 07:26:01 -0000 Don Lewis wrote: > > Normally, lockf(1) gets back EAGAIN and polls for the lock to be > > released. I'm not sure which case in the client rpc.lockd(8) it is. > > Since Solaris doesn't support O_EXLOCK and lockf(1) it wasn't easy for > > me to test, but since the server returns the same result from FreeBSD > > and Solaris, I'm guessing it's a client-side mapping problem. > > Presumably some instance of nlm_denied should return EAGAIN instead. > > I think this gets an nlm4_denied response, which is handled by the > following code in lock_answer(): Historically, this was implemented using O_EXCL to ensure only a single process was allowed to open the file at a time. It may be that that's what's being expected over the wire. I'm pretty sure AIX implemented this by putting an advisory range lock over the entirety of the file; but AIX has a couple of other quirks in the NFS processing that make it less than ideal as a reference implementation. As of Solaris 5.x, the man pages claim that O_EXCL without O_CREAT has undefined behaviour. The SCO manual pages are pretty clear that it means exclusive use (FWIW; do a Google search on "O_EXCL" and "exclusive use"). -- Terry