From owner-freebsd-fs@freebsd.org Thu Jul 2 22:59:31 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 4DEA29935BE for ; Thu, 2 Jul 2015 22:59:31 +0000 (UTC) (envelope-from alex.burlyga.ietf@gmail.com) Received: from mail-yk0-x22e.google.com (mail-yk0-x22e.google.com [IPv6:2607:f8b0:4002:c07::22e]) (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 0468A2A0E for ; Thu, 2 Jul 2015 22:59:31 +0000 (UTC) (envelope-from alex.burlyga.ietf@gmail.com) Received: by ykfy125 with SMTP id y125so82028727ykf.1 for ; Thu, 02 Jul 2015 15:59:30 -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=ceWq26hfN1eCoRPjUSv5kx6IgnmaXjJ5N8bBWmN9P44=; b=XEx+UfgqSvuKpxgEAhIjS8UsnKnEv0B0/c/pvMqKXPw4wDcx+ohBIKhj9TRG6hzdwV E6QrNJbuZOlpRYkyLZmACCVqVGaIyE/eTWWBaYnh40uaUhftdX3jTzKoW1YYZWpi6YWI ir9p+b7cQhidrhx5Qh93tBIgvXVkKRX5NorjQdQG4wMdE2cuhwnxBpjIeHnYBOQRaDJs 4jkF/Y2qnvZX44yZByScPRxA6rwLRVr26Rkal2zDjTtu1XrA71FsrpkUjn3xTotahL0d pF/+ENA8rS/2noYwXpjW15mOHybAzl9kjzoACUGpZ9t4tGqDc96Q6G3EMKB+C+61i/1v kMCA== MIME-Version: 1.0 X-Received: by 10.129.85.69 with SMTP id j66mr42333260ywb.40.1435877970013; Thu, 02 Jul 2015 15:59:30 -0700 (PDT) Received: by 10.13.244.65 with HTTP; Thu, 2 Jul 2015 15:59:29 -0700 (PDT) In-Reply-To: References: <1969046464.61534041.1434897034960.JavaMail.root@uoguelph.ca> Date: Thu, 2 Jul 2015 15:59:29 -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: Thu, 02 Jul 2015 22:59:31 -0000 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. 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" >>>