Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Nov 1999 19:41:05 -0800
From:      Doug Barton <Doug@gorean.org>
To:        Conrad Minshall <conrad@apple.com>
Cc:        Alfred Perlstein <bright@wintelcom.net>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Serious locking problem over NFS
Message-ID:  <382B8C51.A80EC784@gorean.org>
References:  <Pine.BSF.4.20.9911111429310.37830-100000@dt054n7c.san.rr.com> <l03130303b4512afbe17b@[17.202.43.185]>

next in thread | previous in thread | raw e-mail | index | archive | help
Conrad Minshall wrote:
> 
> At 4:39 PM -0800 11/11/99, Alfred Perlstein wrote:
> >On Thu, 11 Nov 1999, Doug Barton wrote:
> 
> >>      The following small program illustrates an obscure problem with
> >> file locking with freebsd as an NFS client. I'm aware of the problems with
> >
> >We currently don't support client or server locking.
> >
> >work is in progress, but the dolt that took the job is extremely busy
> >right now. (me)

	Hrrrmm... well to me the weird thing is that it *does* work when both
processes run on the same FreeBSD NFS client. Where it doesn't work is
when the two access points to the same file are on different clients,
which, unfortunately is where (and why) we need it to work. 

> Yup, byte range locking fcntl APIs are present but over NFS they don't work.
> 
> So shouldn't one be able to get entire-file locking with the old-fashioned:
> 
>   open("foo.lockfile", O_CREAT | O_EXCL, 0644)
> 
> You would think so, but my experience is that reliably protects critical
> sections only when using NFS Version 3.  Not V2.  Read about EXCLUSIVE in
> the CREATE procedure in RFC 1813 for another level of detail.

	Ok, thanks for the tip. We are using V3, in fact I'm forcing it. I
considered using O_EXCL but I'm not 100% sure about some of the
implications for the particular application. I'll give it a try though,
thanks for the tip, and the reference. 

Doug
-- 
"Stop it, I'm gettin' misty." 

    - Mel Gibson as Porter, "Payback"


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?382B8C51.A80EC784>