NetBSD/sys/nfs
yamt e38f237e53 if a file is sillyrename'ed because it's a destination of rename,
make sillyrename (try to) use LINK operation rather than RENAME.
PR/33861 from Jed Davis.  he provided the almost same patch.
according to him, it also happen to be what opensolaris does in this case.

from the PR:
> In nfs_rename(), if the destination appears to exist and is "in use"
> (this check is apparently satisfied even if the file isn't in use by
> anything except the rename itself), it will sillyrename it, then delete
> the sillyrenamed file even if the rename fails -- for instance, because
> the "from" file no longer exists on the server.

> mkdir a b; touch a/x; perl -e 'fork(); rename("a/x","b/x") or die "$!\n"'
>
> Afterwards, neither a/x nor b/x will exist.

> 1) Lookup of b/x; fails with NOENT.
> 2) Rename from a/x to b/x; succeeds.
> 3) Lookup of b/x; fails with NOENT.
> 4) Rename from b/x to b/.nfsA23a3; succeeds.
> 5) Rename from a/x to b/x; fails with NOENT.
> 6) Remove of b/.nfsA23a3; succeeds.
2006-07-01 11:29:42 +00:00
..
files.nfs merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
krpc_subr.c Coverity CID 2445: Only set from_p if we succeed so that we free it on error. 2006-04-15 01:25:54 +00:00
krpc.h merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
Makefile don't install nfs_var.h. 2006-01-03 12:47:51 +00:00
nfs_bio.c fix handling of NFSERR_NOTSUPP and NFSERR_BAD_COOKIE, 2006-06-30 09:55:34 +00:00
nfs_boot.c merge yamt-uio_vmspace branch. 2006-03-01 12:38:10 +00:00
nfs_bootdhcp.c Don't use DEBUG, add a new DEBUG_NFS_BOOT_DHCP variable to provide more 2006-03-16 15:55:20 +00:00
nfs_bootparam.c m_freem takes one arg. 2006-04-15 02:49:25 +00:00
nfs_bootstatic.c merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
nfs_export.c - introduce vfs_composefh() and use it where appropriate. 2006-06-17 07:06:50 +00:00
nfs_kq.c integrate kauth. 2006-05-14 21:31:52 +00:00
nfs_node.c integrate kauth. 2006-05-14 21:31:52 +00:00
nfs_nqlease.c - introduce vfs_composefh() and use it where appropriate. 2006-06-17 07:06:50 +00:00
nfs_serv.c wrap long lines and fix indents after kauth merge. 2006-06-30 09:56:03 +00:00
nfs_socket.c nfs_request: don't bother to handle NFSERR_STALEWRITEVERF 2006-06-30 09:55:06 +00:00
nfs_srvcache.c merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
nfs_subs.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
nfs_syscalls.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
nfs_var.h if a file is sillyrename'ed because it's a destination of rename, 2006-07-01 11:29:42 +00:00
nfs_vfsops.c merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
nfs_vnops.c if a file is sillyrename'ed because it's a destination of rename, 2006-07-01 11:29:42 +00:00
nfs.h merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
nfsdiskless.h merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
nfsm_subs.h merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
nfsmount.h integrate kauth. 2006-05-14 21:31:52 +00:00
nfsnode.h integrate kauth. 2006-05-14 21:31:52 +00:00
nfsproto.h bump NFS_MAXDGRAMDATA from 32k to 60k. (ie. near the protocol limit of udp.) 2006-03-14 03:23:23 +00:00
nfsrtt.h merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
nfsrvcache.h merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
nqnfs.h merge FreeBSD timecounters from branch simonb-timecounters 2006-06-07 22:33:33 +00:00
rpcv2.h merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
xdr_subs.h merge ktrace-lwp. 2005-12-11 12:16:03 +00:00