[nfs][client] - Question about handling of the NFS3_EEXIST error in SYMLINK rpc

Rick Macklem rmacklem at uoguelph.ca
Sat Jun 20 23:06:10 UTC 2015


Alex Burlyga wrote:
> Hi,
> 
> NFS client code in nfsrpc_symlink() masks server returned NFS3_EEXIST
> error
> code
> by returning 0 to the upper layers. I'm assuming this was an attempt
> to
> work around
> some server's broken replay cache out there, however, it breaks a
> more
> common
> case where server is returning EEXIST for legitimate reason and
> application
> is expecting this error code and equipped to deal with it.
> 
Btw, since a DRC is a cache, any DRC can fail to handle a duplicate
(because it has fallen out of the cache). Further, many DRCs are only
used for UDP and when a client ends up doing a TCP reconnect (due to
a network partitioning breaking the TCP connection or similar) it will
resend any outstanding RPCs.
- In other words, a DRC doesn`t guarantee that a duplicate won`t be
  performed, it just reduces the likelyhood.
  NFSv4.1 fixes this via sessions, which guarantee exactly once RPC
  semantics.

> To fix it I see three ways of doing this:
>  * Remove offending code
>  * Make it optional, sysctl?
>  * On NFS3_EEXIST send READLINK rpc to make sure symlink content is
>  right
> 
> Which of the ways will maximize the chances of getting this fix
> upstream?
> 
> One more point, old client circa FreeBSD 7.0 does not exhibit this
> problem.
> 
Since the old client didn`t do this, I think that turning it off by
default and having a sysctl to enable it would be fine.
(It is probably left over from the OpenBSD code which was the original
 base for my NFSv4 work.)

rick

> Alex
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"
> 


More information about the freebsd-fs mailing list