Date: Sun, 21 Jun 2015 10:30:34 -0400 (EDT) From: Rick Macklem <rmacklem@uoguelph.ca> To: "alex.burlyga.ietf alex.burlyga.ietf" <alex.burlyga.ietf@gmail.com> Cc: freebsd-fs@freebsd.org Subject: Re: [nfs][client] - Question about handling of the NFS3_EEXIST error in SYMLINK rpc Message-ID: <1969046464.61534041.1434897034960.JavaMail.root@uoguelph.ca> In-Reply-To: <CA%2BJhTNTSC-xPVdpUGcQemVMLUwuQB6D8-3d2HD6WjU%2Bjd1SMNQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_61534039_1057484672.1434897034958 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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. > > 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? > I've attached a patch for testing/review that does essentially #2. It has no effect on trivial tests, since the syscall does a Lookup before trying to create the symlink and fails with EEXIST. Do you have a case where competing clients are trying to create the symlink or something like that, which runs into this? Please test the attached patch, since I don't know how to do that, rick > One more point, old client circa FreeBSD 7.0 does not exhibit this > problem. > > Alex > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > ------=_Part_61534039_1057484672.1434897034958 Content-Type: text/x-patch; name=eexist.patch Content-Disposition: attachment; filename=eexist.patch Content-Transfer-Encoding: base64 LS0tIGZzL25mc2NsaWVudC9uZnNfY2xycGNvcHMuYy5zYXYyCTIwMTUtMDYtMjEgMDk6Mjc6Mzgu NjQwOTQ3MDAwIC0wN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IgdmVyc2lvbnMsIHNpbmNlIHNlc3Npb25zCisJ ICogc2hvdWxkIGd1YXJhbnRlZSAiZXhhY3RseSBvbmNlIiBSUEMgc2VtYW50aWNzLgogCSAqLwot CWlmIChlcnJvciA9PSBFRVhJU1QpCisJaWYgKGVycm9yID09IEVFWElTVCAmJiBuZnNpZ25vcmVf ZWV4aXN0ICE9IDAgJiYgKCFORlNIQVNORlNWNChubXApIHx8CisJICAgIG5tcC0+bm1fbWlub3J2 ZXJzID09IDApKQogCQllcnJvciA9IDA7CiAJcmV0dXJuIChlcnJvcik7CiB9Cg== ------=_Part_61534039_1057484672.1434897034958--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1969046464.61534041.1434897034960.JavaMail.root>