[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: stale lock files

Roger Leigh <rleigh@whinlatter.ukfsn.org> writes:

> Goswin von Brederlow <brederlo@informatik.uni-tuebingen.de> writes:
>> Roger Leigh <rleigh@whinlatter.ukfsn.org> writes:
>>> Goswin von Brederlow <brederlo@informatik.uni-tuebingen.de> writes:
>>>> Write the pid and host to the lock file. When you detect a lock and
>>>> the lock is on the local host then check the pid is still valid. If
>>>> not the lock is stale. If the lock is from a remote host there is
>>>> little you can do but ask.
>>> Why not use fcntl/lockf byte region locking on the entire file?  It
>>> gets released as soon as the process terminates, so there are no
>>> issues with stale locks, and it works over NFS.
>> NFS isn't everything.
> Of course, but you get that extra feature "for free".  Why would that
> be a be something to avoid?

Because NFS isn't everything.

What do you do on fuse, afs, coda, oracle fs, lustrefs? Do they all
have fcntl? What if the nfs has no lockd running?

I'm not saying to avoid a good thing. But you might not always have


Reply to: