From owner-freebsd-fs@freebsd.org Fri Jul 3 01:22:36 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD1FC993F15 for ; Fri, 3 Jul 2015 01:22:36 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 659591B67 for ; Fri, 3 Jul 2015 01:22:35 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B9AwBY45VV/61jaINbg2ZfBoMZuhoJgWQKhS5KAoIJFAEBAQEBAQGBCoQjAQEBAwEBAQEgKyALBQsCAQgYAgINGQICIQYBCSYCBAgHBAEcBId5AwoIDbcDkDINhWABAQEBAQUBAQEBAQEBG4EhiimCTYFnAQEFFzQHgmiBQwWUEoRhhDZrgx5Eg1CINYMsgz2DWwImY4FagVkiMQEGgQY6gQQBAQE X-IronPort-AV: E=Sophos;i="5.15,396,1432612800"; d="scan'208";a="223564660" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 02 Jul 2015 21:22:34 -0400 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id E491915F533; Thu, 2 Jul 2015 21:22:34 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id YK7_2h4WZww8; Thu, 2 Jul 2015 21:22:34 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 70F6415F54D; Thu, 2 Jul 2015 21:22:34 -0400 (EDT) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vqaZ4-RiwksL; Thu, 2 Jul 2015 21:22:34 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 5606815F533; Thu, 2 Jul 2015 21:22:34 -0400 (EDT) Date: Thu, 2 Jul 2015 21:22:34 -0400 (EDT) From: Rick Macklem To: "alex.burlyga.ietf alex.burlyga.ietf" Cc: freebsd-fs Message-ID: <797076669.3619739.1435886554308.JavaMail.zimbra@uoguelph.ca> In-Reply-To: References: <1969046464.61534041.1434897034960.JavaMail.root@uoguelph.ca> Subject: Re: [nfs][client] - Question about handling of the NFS3_EEXIST error in SYMLINK rpc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.10] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF34 (Win)/8.0.9_GA_6191) Thread-Topic: - Question about handling of the NFS3_EEXIST error in SYMLINK rpc Thread-Index: QLE8Kc3+KYQd0YcnUBj0OOjjkjQlOQ== X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 01:22:36 -0000 Alex Burlyga wrote: > Rick, > > I was able to test the patch. Works as expected. With sysctl set to 1 > I can reproduce original issue, setting sysctl to 0 fixes the issue. > I'll leave running tests over night, but everything looks great. > The patch has been committed to head. I don't know if it will be in 10.2. That will be up to re@. rick > Alex > > On Mon, Jun 22, 2015 at 2:02 PM, alex.burlyga.ietf alex.burlyga.ietf > wrote: > > Rick, > > > > Thank you for a quick turn around, see answers inline: > > > > On Sun, Jun 21, 2015 at 7:30 AM, Rick Macklem wrote: > >> 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? > > > > That's exactly failing test case we are running into. > >> > >> Please test the attached patch, since I don't know how to do that, rick > > Great! I'll test it. I was leaning towards option 3 for SYMLINK and > > option 2 for MKDIR. > > This will work. Thanks for taking your time to generate the patch! > > > >> > >>> 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" > >>> >