freebsd-dev/sys/nfsclient
John Baldwin b367632ec2 More gracefully handle stale file handles and attributes when opening a
file via NFS.  Specifically, to satisfy close-to-open-consistency, the NFS
client always performs at least one RPC on a file during an open(2) to see
if the file has changed.  Normally this RPC is an ACCESS or GETATTR RPC
that is forced by flushing a file's attribute cache during nfs_open() and
then requesting new attributes.  However, if the file is noticed to be
stale during nfs_open(), the only recourse is to fail the open(2) call
with ESTALE.  On the other hand, if the ACCESS or GETATTR RPC is sent
during nfs_lookup(), then the NFS client can fall back to a LOOKUP RPC to
obtain the new file handle in the case that a file has been replaced.

This change causes the NFS client to flush the attribute cache during
nfs_lookup() when validating a name cache hit if the attributes fetched
during nfs_lookup() can be reused in nfs_open().  This allows the client
to open a replaced file via the new file handle the first time that it
notices a replaced file rather than failing with ESTALE in some cases.

Reviewed by:	rmacklem, bde
Reviewed by:	mohans (older version)
MFC after:	1 week
2010-05-27 18:07:20 +00:00
..
bootp_subr.c Remove extraneous semicolons, no functional changes. 2010-01-07 21:01:37 +00:00
krpc_subr.c Add missing include to make LINT-VIMAGE build as well. 2009-12-27 10:10:38 +00:00
krpc.h
nfs_bio.c Push down the page queues lock into vm_page_activate(). 2010-05-07 15:49:43 +00:00
nfs_diskless.c Merge the remainder of kern_vimage.c and vimage.h into vnet.c and 2009-08-01 19:26:27 +00:00
nfs_kdtrace.c Simplify code a bit. 2010-02-18 22:10:55 +00:00
nfs_kdtrace.h Fix two bugs in DTrace tracing of accesscache and attrcache load events: 2009-03-24 23:16:48 +00:00
nfs_krpc.c - Move nfs_realign() from the NFS client to the shared NFS code and 2010-02-09 23:45:14 +00:00
nfs_lock.c Remove the old kernel RPC implementation and the NFS_LEGACYRPC option. 2009-06-30 19:03:27 +00:00
nfs_lock.h
nfs_nfsiod.c Fix a race that can occur when nfs nfsiod threads are being created. 2010-01-27 15:22:20 +00:00
nfs_node.c Add LK_NOWITNESS to the vn_lock() calls done on newly created nfs 2009-09-09 20:37:49 +00:00
nfs_subs.c Fix a race that can occur when nfs nfsiod threads are being created. 2010-01-27 15:22:20 +00:00
nfs_vfsops.c Change the current working directory to be inside the jail created by 2010-05-27 03:15:04 +00:00
nfs_vnops.c More gracefully handle stale file handles and attributes when opening a 2010-05-27 18:07:20 +00:00
nfs.h Fix a race that can occur when nfs nfsiod threads are being created. 2010-01-27 15:22:20 +00:00
nfsargs.h
nfsdiskless.h consolidate parsing of nfs root mount options in one place 2006-12-06 02:15:25 +00:00
nfsm_subs.h Remove the old kernel RPC implementation and the NFS_LEGACYRPC option. 2009-06-30 19:03:27 +00:00
nfsmount.h Add a timeout for the negative name cache entries in the NFS client. 2010-01-21 20:57:25 +00:00
nfsnode.h Fix a race that can occur when nfs nfsiod threads are being created. 2010-01-27 15:22:20 +00:00
nfsstats.h
nlminfo.h - Fix leak of struct nlminfo on process exit. 2005-10-26 07:18:37 +00:00