Subject: Re: Mandatory vs. Advisory

From: David Robinson <[email-masked]>
Date: Thu, 16 Jan 2003 14:15:19 -0600 (CST)

> Someone locally made the statement that NFSv4 mandatory locking is provided
> solely to insure "data integrity".

This is not correct, there is a fundemental programming model
difference between advisory locking and mandatory locking.
While it is likely that you can take an application
written for advisory locking and have it work correctly
with mandatory locking, the reverse is not likely to be
true. The purpose of mandatory locking is not to
provide data integrity in the face of non-participating
applications, it cannot provide that. What it does
allow is participating applications to control other
participating applications data access without some
applications explicitly acquiring locks. Unix/POSIX
people are mostly unfamilar with this model, but it
is common in Windows and other environments.

I am not currently implementing NFSv4, but here are some
theoretical answers:

> o) Is anyone planning to enforce mandatory locking on their server for
> NFSv3?

Not technically possible. There is no mechanism for an NFSv3
server to control an I/O operation. It can't know if the
request came from the identify that owns the lock. Not
to mention also sorts of issues like replay.

> o) If a NFSv3 client does not support NLM and an NFSv3 server requires
> mandatory locking (describes a failure case with no user bypass), are
> both/neither considered to be abiding by the NFSv3 protocol?

A NFSv3 server can't require manadatory locking, so the question is moot.

> o) Is it expected that all NFSv3 clients need to support NLM (or
> unmonitored locking) because of mandatory locking?

Again moot. Many clients (and servers) don't support NLM, their
success or failure appears to be dictated by market forces.

The whole interaction of non-NFSv4 clients and servers with
other protocols or local access is undefined.  As an example
of an attempt to handle the semantics of two different
protocols, see NetApp's paper on the handling of CIFS and NFSv3.

	-David

---

From: Stevan Steve Allen <[email-masked]>
Date: Thu, 16 Jan 2003 15:56:00 -0800

Mike, David.  Those were the answers I was looking for.  Thank you sirs.