link() not increasing link count on NFS server
Dag-Erling Smørgrav
des at des.no
Mon Nov 26 04:36:54 PST 2007
Robert Watson <rwatson at FreeBSD.org> writes:
> Indeed, and inspection of nfs_vnops.c:nfs_link(): finds:
>
> 1772 /*
> 1773 * Kludge: Map EEXIST => 0 assuming that it is a reply to a retry.
> 1774 */
> 1775 if (error == EEXIST)
> 1776 error = 0;
> 1777 return (error);
>
> Neither Linux nor Solaris appears to have this logic in the client. I
> assume this is, as suggested, to work around UDP retransmissions where
> the reply is lost rather than the request. It appears to exist in
> revision 1.1 of nfs_vnops.c, so came in with 4.4BSD in the initial
> import, but doesn't appear in NetBSD so I'm guessing they've removed
> it.
Wrong, it still exists in NetBSD, but they've separated part of
nfs_link() (including that bit) out into nfs_linkrpc(). They also seem
to have added logic to detect a retransmit:
/*
* Kludge: Map EEXIST => 0 assuming that it is a reply to a retry.
*/
if (rexmit && error == EEXIST)
error = 0;
revision 1.197
date: 2004/05/10 10:40:42; author: yamt; state: Exp; lines: +32 -25
don't do kludge for a reply to a retransmitted request
unless we actually retransmitted the request.
DES
--
Dag-Erling Smørgrav - des at des.no
More information about the freebsd-current
mailing list