From owner-freebsd-fs@freebsd.org Fri Apr 21 19:51:43 2017 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 9083FD49071 for ; Fri, 21 Apr 2017 19:51:43 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670065.outbound.protection.outlook.com [40.107.67.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41DD7A9B for ; Fri, 21 Apr 2017 19:51:42 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR01MB0180.CANPRD01.PROD.OUTLOOK.COM (10.169.141.138) by YQBPR01MB0177.CANPRD01.PROD.OUTLOOK.COM (10.169.141.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Fri, 21 Apr 2017 19:51:39 +0000 Received: from YQBPR01MB0180.CANPRD01.PROD.OUTLOOK.COM ([10.169.141.138]) by YQBPR01MB0180.CANPRD01.PROD.OUTLOOK.COM ([10.169.141.138]) with mapi id 15.01.1047.017; Fri, 21 Apr 2017 19:51:39 +0000 From: Rick Macklem To: Jim Phillips CC: Doug Rabson , "freebsd-fs@freebsd.org" Subject: Re: NFSv4 Linux client atime for exclusive create Thread-Topic: NFSv4 Linux client atime for exclusive create Thread-Index: AQHStW9Xwd3iU1MkQkKHy7u7vlbe/6HM0kmAgABXYs2AABEAkYAAvc8AgAD5RDaAARsjgIAAOWwo Date: Fri, 21 Apr 2017 19:51:39 +0000 Message-ID: References: , , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: ks.uiuc.edu; dkim=none (message not signed) header.d=none;ks.uiuc.edu; dmarc=none action=none header.from=uoguelph.ca; x-microsoft-exchange-diagnostics: 1; YQBPR01MB0177; 7:0wgqwbPLyu0eYJSOyC6RL3YUaHBOWlE41IaBKU5ML/3eau+v1gM9N8OC6v/ulXj3D0/ka1jZg4nq9fnCE5kXqgcs8aZURtHIcxf8T8e+C5taUwFtn1C90PYXmdpSpnwOO/TrJ9ibzSutWRtIlr8/YkvosiIGGWWbCzEKbHeLi7nuDcjWzBmfrl9M2Nmu6BsP2112OFi5NtmgnKE88FmCuQNS32wpqMa2onJ3mCQf01i3H6AufWG17qO737zzMEq9zgHbCMpU8tZBNLAImiV9XdK4jRVjOrJK04WQ5pG7pOH6aIviYroPjTQycuIOJiGSlc40J+ukSzul7QByeZrbHA== x-ms-office365-filtering-correlation-id: 3021b9ef-765f-4013-f569-08d488efd37f x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:YQBPR01MB0177; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(6072148); SRVR:YQBPR01MB0177; BCL:0; PCL:0; RULEID:; SRVR:YQBPR01MB0177; x-forefront-prvs: 02843AA9E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(39850400002)(24454002)(377454003)(8936002)(5890100001)(53936002)(3280700002)(25786009)(53546009)(6436002)(77096006)(6506006)(74316002)(122556002)(110136004)(33656002)(38730400002)(93886004)(86362001)(102836003)(54906002)(305945005)(3660700001)(2171002)(189998001)(6246003)(229853002)(55016002)(4326008)(74482002)(76176999)(81166006)(54356999)(50986999)(5660300001)(7696004)(6916009)(2906002)(2900100001)(8676002)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR01MB0177; H:YQBPR01MB0180.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2017 19:51:39.2301 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR01MB0177 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2017 19:51:43 -0000 Ok. Thanks for testing it. It is committed to head and will be MFC'd in a couple of weeks. Sorry it was broken for sooooo looonnnggg, rick ________________________________________ From: Jim Phillips Sent: Friday, April 21, 2017 12:25:23 PM To: Rick Macklem Cc: Doug Rabson; freebsd-fs@freebsd.org Subject: Re: NFSv4 Linux client atime for exclusive create Tested the new patch and it fixes the issue (as did the old one). Jim On Thu, 20 Apr 2017, Rick Macklem wrote: > Doug Rabson wrote: >> That was actually going to me my next suggestion, honest. Hopefully that= fixes the >problem, if not its a bug in the Linux client. > Yep, the attached patch fixed the problem. > > I wrote: >> I'll come up with a patch that sets the atime bit in the EXCLUSIVE4 Open >> reply and see if that changes the Linux client. > The attached patch sets the TIMEACCESS bit in the reply for both NFSv4.0 = and NFSv4.1 > and fixes the problem for both cases for a quick test with the Linux clie= nt. (With this > bit set in the reply, Linux sets TIMEACCESSSET in the Setattr.) > > Doug Rabson wrote: >> Is the client using EXCLUSIVE4 or EXCLUSIVE4_1 for the open? If its EXCL= USIVE4_1, i.e. the >mode which allows attribute setting during the open, th= e client should use the value of >the supattr_exclcreat attribute (see sect= ion 5.8.1.14 of rfc5661) to figure out what >attributes can be set. In this= case, supattr_exclcreat should not include atime which should > The FreeBSD NFSv4.1 server does exclude atime from the supattr_exclcreat= bitset and > it checks for it set and returns the correct error. > However, like NFSv4.0, the code didn't set the TIMEACCESS attribute bit i= n the > EXCLUSIVE4_1 reply. (The attached little patch fixes this for both NFSv4.= 0 and NFSV4.1.) > > Thanks everyone for your help. > > I am thinking that storing the create_verifier in an extended attribute f= or file > systems that support extended attributes is a good idea, since it will al= low NFSv4.1 > clients to avoid following the Open/Exclusive4_1 with a Setattr RPC. > Anyone else have an opinion w.r.t. this? > (I'll leave this for a future commit, depending on what others think of t= he idea.) > > I will probably commit the attached patch soon, rick > ps: Jim, I don't think there is any point in testing the other patch, alt= hough I suspect > it would fix the problem. You could test this one, if you can easily= do it. > pss: My only excuse for never doing this is that it is one sentence in an= RFC of > several hundred pages;-) >