|
Home > Archive > Unix Programming > May 2007 > NFS file lock
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| chsalvia@gmail.com 2007-05-29, 7:23 am |
| There seems to be a lot of contradictory information floating around
as to what types of file locks work over NFS. My question is, does
fcntl work on NFS? That is, if one computer on a network locks a file
on a mounted NFS directory, will another computer which attempts to
lock the same file over the network be able to recognize the lock?
| |
|
| On May 29, 2:50 am, chsal...@gmail.com wrote:
> There seems to be a lot of contradictory information floating around
> as to what types of file locks work over NFS. My question is, does
> fcntl work on NFS? That is, if one computer on a network locks a file
> on a mounted NFS directory, will another computer which attempts to
> lock the same file over the network be able to recognize the lock?
NFS locks are OS vendor specific and thus functionality will vary
widely.
Most, if not all, NFS subsystems have specific configuration settings
for
NFS locking. Settings such as time before failing a lock, etc.
However,
I have not been able to replicate the behavior that "lockf()" or
fcntl()
locking have when locking on the same server, specifically "infinite"
waiting for a lock.
I use a custom logical token lock daemon sending a a common token
string and a max time waiting for the lock. All systems on the
network
must use the same logical token to lock the same physical entity.
|
|
|
|
|