Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Nov 1999 10:20:11 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Conrad Minshall <conrad@apple.com>
Cc:        Alfred Perlstein <bright@wintelcom.net>, Doug Barton <Doug@gorean.org>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Serious locking problem over NFS
Message-ID:  <199911121820.KAA23792@apollo.backplane.com>
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
:
: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.
:
:--
:Conrad Minshall ... conrad@apple.com ... 408 974-2749
:Apple Computer ... Mac OS X Core Operating Systems ... NFS/UDF/etc

    open w/ O_CREAT|O_EXCL does work over NFS but, of course, suffers from
    the 'process died and never removed the file' problem.

    flock() and POSIX fctl locks work locally between processes on any
    given host, but will NOT work between hosts.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>


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?199911121820.KAA23792>