freebsd-dev/sys/nfsclient
Robert Watson 34f2db4676 Remove hacks from the NFSv2/3 client intended to handle a lack of a
server-side RPC retranmission cache for non-idempotent operations: these
hacks substituted 0 (success) for the expected EEXIST in the event that
a target name already existed for LINK, SYMLINK, and MKDIR operations,
under the assumption that EEXIST represented a second application of the
original RPC rather than a true failure.

Background: certain NFS operations (in this case, LINK, SYMLINK, and
MKDIR) are not idempotent, as they leave behind persisting state on the
server that prevents them from being replayed without an error;if an UDP
RPC reply is lost leading to a retransmission by theclient, the second
reply will return EEXIST rather than success, asthe new object has
already been created.  The NFS client previouslysilently mapped the
EEXIST return into success to paper over thisproblem.

However, in all modern NFS server implementations, a reply cache is kept
in order to retransmit the original reply to a retransmitted request,
rather than performing the operation a second time, allowing this hack
to be avoided.  This allows link()-based filelocking over NFS to operate
correctly, as an application requestingthe creation of a new link for a
file to tell if it succeededatomically or not.

Other NFS clients, including Solaris and Linux, generally follow this
behavior for the same reasons.  Most clients also now default to TCP,
which also helps avoid the issue of retransmitted but non-idempotent
requests in most cases.

Reported by:	Adam McDougall <mcdouga9 at egr dot msu dot edu>,
		Timo Sirainen <tss at iki dot fi>
Reviewed by:	mohans
MFC after:	1 week
2007-11-19 16:03:21 +00:00
..
bootp_subr.c Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which 2007-08-06 14:26:03 +00:00
krpc_subr.c Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which 2007-08-06 14:26:03 +00:00
krpc.h
nfs_bio.c Fix for a very rare race, caused by the nfsiod wakeup and nfsiod idle 2007-09-25 21:08:49 +00:00
nfs_diskless.c consolidate parsing of nfs root mount options in one place 2006-12-06 02:15:25 +00:00
nfs_lock.c Attempt to rationalize NFS privileges: 2007-04-21 18:11:19 +00:00
nfs_lock.h
nfs_nfsiod.c Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
nfs_node.c Make insmntque() externally visibile and allow it to fail (e.g. during 2007-03-13 01:50:27 +00:00
nfs_socket.c NFS MP scaling changes. 2007-10-12 19:12:21 +00:00
nfs_subs.c NFS MP scaling changes. 2007-10-12 19:12:21 +00:00
nfs_vfsops.c Add the following mount options to the nfs_opts array: 2007-10-27 16:28:05 +00:00
nfs_vnops.c Remove hacks from the NFSv2/3 client intended to handle a lack of a 2007-11-19 16:03:21 +00:00
nfs.h NFS MP scaling changes. 2007-10-12 19:12:21 +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 fix a problem with XID re-use when a server returns NFSERR_JUKEBOX. 2005-11-21 18:39:18 +00:00
nfsmount.h NFS MP scaling changes. 2007-10-12 19:12:21 +00:00
nfsnode.h Over NFS, an open() call could result in multiple over-the-wire 2007-03-09 04:02:38 +00:00
nfsstats.h
nlminfo.h - Fix leak of struct nlminfo on process exit. 2005-10-26 07:18:37 +00:00