Subject: [nfsv4] Locking Sematics

From: Syam Pannala <[email-masked]>
Date: Mon, 14 Mar 2005 18:09:40 -0800 (PST)

Hi,

One way to implement the read and write locks on the server side would
be to implement read locks as shared locks and write locks as exclusive
locks. That is, any number of clients can take a read lock on a given
range and only 1 client can take a write lock on a given range. In this
model, only write operations are prevented in presence of conflicting
locks and read operations always go through. This is my understanding
of the POSIX model from the fcntl man page.

Another model would be implement read locks as locks preventing read
operations and write locks as locks preventing write operations. Any
given range on a file can only be locked by exactly 1 client (or
lockowner)[otherwise, you can happily make a given range inaccessible
to everybody -- this seems quite pointless under most conditions]. The
problem with this is that read locks do not seem to be terribly useful
to anybody and having exclusive locking seems overly restrictive.

The problem is that preventing a certain operation from occurring seems
useful under one set circumstances and having more than one locker lock
a region seems useful under another (shared locking to prevent a region
from changing).

I am ignoring the question of advisory vs. mandatory -- I am assuming
that advisory is exactly the same as mandatory if we disable lock
checking during read and write.

Am I missing anything in that rfc 3530 that actually explains this
distinction of read and write? If not, would implementing the
first/second model leave me unable to operate with large number of
clients that implement the spec correctly?

Any guidance in this matter will be greatly appreciated.

Thanks,
Syam

__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 

_______________________________________________
nfsv4 mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/nfsv4

---

From: Trond Myklebust <[email-masked]>
Date: Mon, 14 Mar 2005 22:45:28 -0500

> of the POSIX model from the fcntl man page.

What kind of locks are you referring to here? For byte range locks, this
is exactly how the server currently implements them.
For Windows SHARE locks, OTOH, you cannot do this, since that would
conflict with byte range locks, and could cause deadlocks for clients.

Cheers,
  Trond
-- 
Trond Myklebust <[email-masked]>

---

From: Trond Myklebust <[email-masked]>
Date: Mon, 14 Mar 2005 22:57:14 -0500

> is exactly how the server currently implements them.
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ make that "most
servers currently implement them" since I failed to notice that this was
posted to the IETF working group list

Cheers,
  Trond