Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bionet!ames!ucsd!helios.ee.lbl.gov!pasteur!buddy.Berkeley.EDU!deboor From: deboor@buddy.Berkeley.EDU (Adam R de Boor) Newsgroups: comp.unix.wizards Subject: Re: Locks for exclusive access to resources Summary: unlink ain't atomic Message-ID: <14834@pasteur.Berkeley.EDU> Date: 21 Jun 89 05:32:31 GMT References: <1020@twwells.uucp> <1989Jun14.052648.20183@twwells.com> Sender: news@pasteur.Berkeley.EDU Reply-To: deboor@buddy.Berkeley.EDU.UUCP (Adam R de Boor) Distribution: usa Organization: University of California, Berkeley Lines: 9 unlink isn't an atomic operation under NFS. You'd think it would be (you'd think file creation would be atomic too...), but it isn't. I've had cases where unlinks of the same file on two systems both succeeded, though *one* should have returned ENOENT. I eventually went with an election algorithm (slightly different problem -- the locking was to determine which server was to be the master...) a