From owner-freebsd-hackers Fri Nov 12 10:20:25 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id AB09B14FDB for ; Fri, 12 Nov 1999 10:20:16 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id KAA23792; Fri, 12 Nov 1999 10:20:11 -0800 (PST) (envelope-from dillon) Date: Fri, 12 Nov 1999 10:20:11 -0800 (PST) From: Matthew Dillon Message-Id: <199911121820.KAA23792@apollo.backplane.com> To: Conrad Minshall Cc: Alfred Perlstein , Doug Barton , freebsd-hackers@FreeBSD.ORG Subject: Re: Serious locking problem over NFS References: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : :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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message