All of lore.kernel.org
 help / color / mirror / Atom feed
* File lock with multiple clients
@ 2005-10-20 23:01 petter.knutsen
  2005-10-21  0:43 ` Neil Brown
  0 siblings, 1 reply; 9+ messages in thread
From: petter.knutsen @ 2005-10-20 23:01 UTC (permalink / raw)
  To: nfs

Hello,

I have a question about NFS and file locking on multiple clients.

Let's say I have a NFS server and two clients; "client a" and "client b". Is
it possible to flock() a file on "client a", and make "client b" respect a's
lock?

I've managed to lock files on "client a" and let other processes on "client
a" honour the locks, but "client b" doesn't seem to be able to see the lock=
s.


Before I research any further, does anyone know if this is possible?

Thanks in advance,

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  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: File lock with multiple clients
@ 2005-10-21 10:25 petter.knutsen
  2005-10-21 10:40 ` Vincent Roqueta
  0 siblings, 1 reply; 9+ messages in thread
From: petter.knutsen @ 2005-10-21 10:25 UTC (permalink / raw)
  To: nfs, neilb

> 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  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <20051021102518.7F60EEE8E@mx1.suse.de>]
* Re: File lock with multiple clients
@ 2005-10-21 15:22 petter.knutsen
  0 siblings, 0 replies; 9+ messages in thread
From: petter.knutsen @ 2005-10-21 15:22 UTC (permalink / raw)
  To: nfs, trond.myklebust

> Note that this is not entirely accurate any more. Recent kernels will
> emulate flock() over NFS by using fcntl() locks.

I've gotten fcntl() to work, but it doesn't seem that flock() works between
clients. Do you know which kernel version implemented the emulation? Are we
talking about the latest 2.6.14 rc, or should a 2.6.x be sufficient? Also,
should this emulation be enough to make flock() work between clients?

Thanks for all your help.

--
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  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <cmu-lmtpd-31394-1129908191-0@mail-imap5.uio.no>]

end of thread, other threads:[~2005-10-21 16:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-20 23:01 File lock with multiple clients petter.knutsen
2005-10-21  0:43 ` Neil Brown
2005-10-21  1:20   ` Trond Myklebust
  -- strict thread matches above, loose matches on Subject: below --
2005-10-21 10:25 petter.knutsen
2005-10-21 10:40 ` Vincent Roqueta
2005-10-21 11:04   ` Vincent Roqueta
     [not found] <20051021102518.7F60EEE8E@mx1.suse.de>
2005-10-21 11:47 ` Neil Brown
2005-10-21 15:22 petter.knutsen
     [not found] <cmu-lmtpd-31394-1129908191-0@mail-imap5.uio.no>
2005-10-21 16:32 ` Trond Myklebust

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.