Skip to contentSkip to conversation

File lock with multiple clients

DISCUSSION [email protected] 2 participants 3 messages Oct 21, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 4 lines

Check the man page: "man flock":
=20
Use fcntl or lockf (which is wrapper for fcntl) if you want to lock over NFS.

As Trond said, flock() seems to work by emulating fcntl(), but regardless of whether I'm using fcntl() directly or flock() with emulation, should my scenario with two clients work, where one client locks and the other client honouring the lock?

As I said, it works between processes on the same client, but not between processes on different clients.

I would appreciate if someone could tell me if this is possible or not, so I can either abandon NFS and look for alternatives or, if it should work, go back and look for flaws in my setup. :-)

--
Petter=

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw

Le vendredi 21 Octobre 2005 12:25, [email protected] a =E9crit=A0:

Quoted 5 lines
Quoted 4 lines

Check the man page: "man flock":

Use fcntl or lockf (which is wrapper for fcntl) if you want to lock over NFS.

Quoted 7 lines

As Trond said, flock() seems to work by emulating fcntl(), but regardless of whether I'm using fcntl() directly or flock() with emulation, should my scenario with two clients work, where one client locks and the other client honouring the lock?

As I said, it works between processes on the same client, but not between processes on different clients.

I am going to test that on different clients.

Quoted 1 line

I would appreciate if someone could tell me if this is possible or not

That is possible. (advisory locking)
I have got some experiences of that the last weeks.

Here is for NFSv4.
http://nfsv4.bullopensource.org/tools/tests/page39.php

Quoted 2 lines

, so I can either abandon NFS and look for alternatives or, if it should work, go back and look for flaws in my setup. :-)=20

Vincent

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#2 lore raw

Le vendredi 21 Octobre 2005 12:40, Vincent Roqueta a =E9crit=A0:

Quoted 7 lines

Le vendredi 21 Octobre 2005 12:25, [email protected] a =E9crit=A0:

Quoted 6 lines
Quoted 4 lines

Check the man page: "man flock":

Use fcntl or lockf (which is wrapper for fcntl) if you want to lock over NFS.

As Trond said, flock() seems to work by emulating fcntl(), but regardle=

ss

Quoted 5 lines
Quoted 5 lines

of whether I'm using fcntl() directly or flock() with emulation, should my scenario with two clients work, where one client locks and the other client honouring the lock?

As I said, it works between processes on the same client, but not betwe=

en

Quoted 3 lines
Quoted 1 line

processes on different clients.

I am going to test that on different clients.

I have tested it. That works.
kernel : linux 2.6.14-rc4-CITI_NFS4_ALL-1. It may works on older kernel too.

Vincent

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs