From owner-freebsd-fs@freebsd.org Sat Jul 4 01:01:15 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 0E7679927F0 for ; Sat, 4 Jul 2015 01:01:15 +0000 (UTC) (envelope-from alex.burlyga.ietf@gmail.com) Received: from mail-yk0-x22f.google.com (mail-yk0-x22f.google.com [IPv6:2607:f8b0:4002:c07::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFF8C197C for ; Sat, 4 Jul 2015 01:01:14 +0000 (UTC) (envelope-from alex.burlyga.ietf@gmail.com) Received: by ykdr198 with SMTP id r198so107146542ykd.3 for ; Fri, 03 Jul 2015 18:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=B/k5ZhOBcDBpgSKxYKPVM547rCpCbhi2ON92T5wmFVU=; b=M07nkpuaRNBszo0srOogvxc0+icseXWzNXjHLlOeaY8ICSOcJAACHwX+gqfmcqVDuO Wb0ZdICuoZ0oYjhcnS9SF2kxhLA5gBaMnuM1WB2A7mz5WZm8CnlnYYprpUzNy6sped3d JRolFqBNVWTojA1PkhR2yjIPWCXZoe5TSyXDOhulhI6yehicV/Zzlw9Dx8sd2QrhNqm4 v4p+kRbXGyyTOqjFsmL70IQmiHkHKwvDv0v+YHQbABjtSl4KYY8hBOKSzOkRIFCXU9AR 2WxJjJupggoejHhSUXWlNVdUeQ70trwxV2uEbv01iy/RExGwR/pUS22FD5CVuwybVpe0 Dt1g== MIME-Version: 1.0 X-Received: by 10.129.138.2 with SMTP id a2mr45144139ywg.149.1435971673404; Fri, 03 Jul 2015 18:01:13 -0700 (PDT) Received: by 10.13.244.65 with HTTP; Fri, 3 Jul 2015 18:01:13 -0700 (PDT) In-Reply-To: <797076669.3619739.1435886554308.JavaMail.zimbra@uoguelph.ca> References: <1969046464.61534041.1434897034960.JavaMail.root@uoguelph.ca> <797076669.3619739.1435886554308.JavaMail.zimbra@uoguelph.ca> Date: Fri, 3 Jul 2015 18:01:13 -0700 Message-ID: Subject: Re: [nfs][client] - Question about handling of the NFS3_EEXIST error in SYMLINK rpc From: "alex.burlyga.ietf alex.burlyga.ietf" To: Rick Macklem Cc: freebsd-fs Content-Type: text/plain; charset=UTF-8 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: Sat, 04 Jul 2015 01:01:15 -0000 Great, hopefully this will get picked up for 10.2 so we can pick it up from upstream. Alex On Thu, Jul 2, 2015 at 6:22 PM, Rick Macklem wrote: > 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" >> >>> >>