NFS v4L is a new NFS for Linux and possibly FreeBSD which implements the v4 protocols and adds leasing capabilities.
NFS v4L's goal is to be an NFS implementation with the following
characterists:
The Team
Dr. Moshe Bar, Israel and Italy
Mark Veltzer, Israel
Amnon Shiloh, Australia
What Is NFS Leasing?
The basic principle behind the leasing concept is that the NFS server
disables client caching of files by performing a server-to-client call-back
whenever concurrent write sharing could occur. This, in turn will force
the
NFS-client to flush its caches and to do all subsequent I/Os on that file
with
synchronous RPCs. An NFS server maintains a record of the open state of
files for all clients, and uses this to determine when concurrent write
sharing
might occur.
This open-state information might also be referred to as an infinite-term
lease for the file, with explicit lease cancellation. My new NFS, on the
other
hand, uses a short-term lease that expires due to a time out after a maximum
of, say, one minute, unless explicitly renewed by the client. The fundamental
difference is that an NFS leasing client must keep renewing a lease to
use
cached data, whereas a conventional NFS client assumes the data is valid
until cancelled by the server; or the file is closed. Using leases permits
the
server to remain "stateless," since the soft state information, which consists
of the set of current leases, is moot after one minute, when all the leases
expire.
Whenever an NFS client wishes to access a file's content, it must hold
one
of three types of lease: read-caching, write-caching, or non-caching. The
latter type requires that all file operations be done synchronously with
the
server via the appropriate RPCs. A read-caching lease allows for client
data
caching, but no modifications may be done. It may, however, be shared
between multiple clients.
Note that the time lines are nowhere near to scale, since a client/server
interaction will normally take less than one hundred milliseconds, whereas
the normal lease duration is around 30 seconds. Every lease includes a
modrev value, which changes upon every modification of the file. It may
be
used to check to see if data cached on the client is still current.
A write-caching lease permits delayed write caching, but requires that
all
data be pushed to the server when the lease expires or is terminated by
an
eviction call-back. When a write-caching lease has almost expired, the
client will attempt to extend the lease if the file is still open, but
is required to
push the delayed writes to the server if renewal fails. The writes may
not
arrive at the server until after the write lease has expired on the client,
but
this does not result in a consistency problem, so long as the write lease
is
still valid on the server. If a write RPC is done on the server after the
write
lease has expired on the server, this could be considered an error since
consistency could be lost, but like FreeBSD's NFS leasing, my
implementation will just ignore this logical error.
FreeBSD, has had an NFS leasing implementation for some time now, but a
porting to Linux is not directly possible due to the wide divergence in
the
buffering and page-caching architectures on both platforms. If you feel
like
contributing to my project, jump to the project's site at SourceForge.
Page last updated on May 29, 2001 10:23