home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.protocols.nfs
- Path: sparky!uunet!elroy.jpl.nasa.gov!ucla-cs!twinsun!eggert
- From: eggert@twinsun.com (Paul Eggert)
- Subject: Re: what locking techniques work over NFS?
- Message-ID: <biUZ?6$U@twinsun.com>
- Keywords: file locking
- Sender: usenet@twinsun.com
- Nntp-Posting-Host: farside
- Organization: Twin Sun, Inc
- References: <1992Jul30.021633.11818@philips.oz.au>
- Date: Fri, 31 Jul 1992 00:39:03 GMT
- Lines: 30
-
- rod@philips.oz.au (Rod Roberts) writes:
-
- >which of the following file locking techniques work with multiple hosts
- >accessing the same filesystem over NFS.
-
- >1. lockf() (System V)
- This works only if lockd works. lockd's bugs are legendary.
-
- >2. flock() (BSD)
- This isn't even advertised to work.
-
- >3. link() (generic) fails if new link already exists
- This doesn't always work. E.g. suppose a client finishes an operation
- and unlocks by issuing an unlink request, and suppose the unlink
- executes on the server, but the response is lost. Eventually the
- client will retry the unlink request, and (assuming the idempotency cache
- overflows) the server will unlink the file again -- even if someone
- else has linked it in the meantime and is in the middle of an operation.
-
- >4. create() (generic) fails if file exists and caller does no have write
- > permission
- This doesn't always work, using a scenario similar to the above.
- Also, watch out if you're `root'.
-
- >5. open() (POSIX) fails if O_CREAT and O_EXCL flags are present an the file
- > exists.
- This doesn't work; NFS has no notion of O_EXCL.
-
-
- They don't call it ``Not a File System'' for nothing.
-