Re: [nfsv4] RFC: New DelegReturn_NoFH operation for NFSv4.2?

Trond Myklebust <trondmy@hammerspace.com> Wed, 17 April 2024 23:56 UTC

Return-Path: <trondmy@hammerspace.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3BD7EC14F6BF for <nfsv4@ietfa.amsl.com>; Wed, 17 Apr 2024 16:56:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.098
X-Spam-Level:
X-Spam-Status: No, score=-7.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=hammerspace.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o4RmEjU3xOao for <nfsv4@ietfa.amsl.com>; Wed, 17 Apr 2024 16:56:37 -0700 (PDT)
Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2134.outbound.protection.outlook.com [40.107.223.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 06934C14F69D for <nfsv4@ietf.org>; Wed, 17 Apr 2024 16:56:36 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RAAxPypF/T+D2v8BZWYkHRWllqnNkgVwZ2EfWZmyQ6VlWlCVleTXPaEkFoK1WB1lHMeMAdzFAo1eXgnfHBKThxFoAnJTf3tpSAcsVKO5HhJtuA/eUBvFJpDrl9ucKrquQewi+cTtcbbx3PVmXyaFW0F26U+V3n87HRmZ0KKiZ8nZjfyak2+w/M4An1+PusmwDaWXOk0nZfTQWsPjpmvSOt1PAfYk+0asQKhyXYNPU+nrZZSCSYbfUsoi9Mp4D1q+QQAgBvbFHkPj4C9VTgsQZoE212UWdmQhqYudy5U4HylvD5G6h7UjIiGnGhfpNlJrYclCYpSWqU9F7geWEJraEw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TgUzrfdg1pRVXvEJDUPVO76axV9k9LHjyXU8uWINw0g=; b=adeqpoHBKZm6KSe7Ekv7FzDsrzh+RPfPJSSdAPafGDb5Rruip5CUjViiAtOkQrbFk0yCL4oOiPQNCMqtv3fH6yEabYg7z3ce/RD8hzj9ha7yMdcj1eDdoy8kJ9fFMULZvZe8/HkCOwy++pwO+11p9F9R/2b0/rUyibBvbw7jh4AHikuIm0WtwehzoPIIxywsZCqe8H9JVZSgQ5xnd2jtk7j6tuh12obOLSF6gGZ+VNcXpA9rgQPQLYYmbduuPsznh9xDON7tZbrMwerJfTcqs4ESAkXxOejSzInz8nqVX3cd0B3S8Zxbp0QueuORhSsx/4fyvzo9IE4J30zqVq7yyw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hammerspace.com; dmarc=pass action=none header.from=hammerspace.com; dkim=pass header.d=hammerspace.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hammerspace.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TgUzrfdg1pRVXvEJDUPVO76axV9k9LHjyXU8uWINw0g=; b=f4Xi93yq2TISOaRXnP5VtSMotF2AZiNBnSjZMqtYOZ8MJVzuUJmWzuEycIPYKcZGo1ETnIZzZPywOExJUa6T622TqyJCmx8httqG5bA0eyynd4+hYOGDK1yG+50lT7xJ2bH22JgE1D9LEbyjfE5Sc9bhYbMyjFpMjsTQEf4kJfs=
Received: from CH0PR13MB5084.namprd13.prod.outlook.com (2603:10b6:610:111::7) by PH7PR13MB6091.namprd13.prod.outlook.com (2603:10b6:510:2a4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Wed, 17 Apr 2024 23:56:30 +0000
Received: from CH0PR13MB5084.namprd13.prod.outlook.com ([fe80::5bb5:501a:fb40:5057]) by CH0PR13MB5084.namprd13.prod.outlook.com ([fe80::5bb5:501a:fb40:5057%6]) with mapi id 15.20.7472.037; Wed, 17 Apr 2024 23:56:30 +0000
From: Trond Myklebust <trondmy@hammerspace.com>
To: "davenoveck@gmail.com" <davenoveck@gmail.com>, "rick.macklem@gmail.com" <rick.macklem@gmail.com>
CC: "nfsv4@ietf.org" <nfsv4@ietf.org>
Thread-Topic: [nfsv4] RFC: New DelegReturn_NoFH operation for NFSv4.2?
Thread-Index: AQHaj5HPuHsSiF/StEqz/bB9rT0sn7Fq0fYAgAAdY4CAAAqNgIAAdGwAgADsOwCAAMwKgA==
Date: Wed, 17 Apr 2024 23:56:30 +0000
Message-ID: <d4b197a4dcad15d30b4aec25adbd5bb08485f121.camel@hammerspace.com>
References: <CAM5tNy407R30WQqCuzFE+feRz42wkaAAGOwiHwqFoWZSpwfT0A@mail.gmail.com> <9D17BB42-54A9-46DB-8E4F-3FF852EEAC90@hammerspace.com> <CADaq8jePTg8WVFe2FmrwgUjyc7H9v=Ln7g2FT9G5DJtkpVSF3Q@mail.gmail.com> <CAM5tNy6-ADHC1z9HJME0r5o-hDeG9OucE_SWftDrqE4JnMrhAg@mail.gmail.com> <adc3fb5ed3674078c64399b19891c63b7a1185e4.camel@hammerspace.com> <CAM5tNy77PNiH6aTWTOyhrofe2cFTg+ga8sFzGbi0EHSfrXz79w@mail.gmail.com> <CADaq8jdifYwzZDkrYnaZwV-_bYs=3z8HxfM7mtUAoPy29uvAig@mail.gmail.com>
In-Reply-To: <CADaq8jdifYwzZDkrYnaZwV-_bYs=3z8HxfM7mtUAoPy29uvAig@mail.gmail.com>
Accept-Language: en-US, en-GB
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=hammerspace.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: CH0PR13MB5084:EE_|PH7PR13MB6091:EE_
x-ms-office365-filtering-correlation-id: 22e6354b-0427-43fa-e607-08dc5f3a009c
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 5E6A0FjTgS6FbCOSyGc0r8mLQ3iyRrA4nFw0Ww/7U5/JwznCZtdetOkVZsthY9A9A+tyJFUO16D4/j+1ijctHoxHRRGFUBj58KD5VD9JZu0iaeimjuSk29c9U1qTflhbQyXH6e9gsHWYk8oBFIibMYCO6wksMMZKQdvO+Fn8XT3H0k4dQ6c02eSiY91F1OzvjY45q/7rJzMnfLorQXhwm+hQdfiNthapXDnMwoQj4ttPqLC/D5xPJzCKwZIXdW0DvCgDw2IlVsk9oJbDxsOEJpZQzaf1BjpMdFkzP04sT/Pa++fa4u8Njy558KIgPBb3QXM+aFJpyWet8Fq8Fw2GyHTi5ECx7rBlHmMrOC1Icbz0Fj45ecCQlNhvaZzOCrm/QxrlH1H0Bi7WUu4jwBbmAwDIbNbfiixwEjM07eyrIPGBkGkoDUfEy7tjkEoLaJ2iyU7rDBUsDAEpNwh1+986nERMztTC7UFW0MRYznrt96RObFJu6JQoPZp17zJKfIk3RscrYrpKQ/WQwwfqU3BZMU1ws10maz6mGlTOr/O6jHJI48RvBn+Y5wMfU5OBMtRlpc6/m4qwGslKFyK/Nq2WzssOwSImYEoaDpH0rBk6pnKZqncOkY/Fs30WH2D3HLf8RfmfF7a9KHOOiCH1yPswtqVr+pJ0FfhX3xZ4LKUh+w8PXnm3TVBoBCiW0Q4E2Go1U/ZlAeyp+MF3aZV5+P/zU15RcDFR/n4TmKbdZWO+3vq0IwtgGuSu1O+M036h5ukefIWuXtN6x3cLdaNYwGeIgDI0fw1xoVeAK1i96MnrBiUw10nENP67qLZlSxwTUkVnCITC7kmJbhHzBcUYM6fID6dpqWmN4alvJ5C5psMEAXfPOsT1W/09DKRsUfQPTjOSdSoBybPXs/MlchzYMm3ZlA3WI6zHTgjy/3sd9iIrrFSsOhS6u8CwWsQJzhgE5yrYfMo6AouKwb6j7cQLl22Qz/a8ZWZfBWAQ7FfgrB1oCRLqgqcsyxUbJDwY8QnIgGndb7KxJriPjRbCOKWjnEZaPERXcU7CmMjveW1R9UNkqOnKieNDEJjNzD8gKxy7M8FcgWef+Yt++qlb/ukedqvSl472myn+d3A9gVgktx0uu8DGcX0FqcelZZtfQRazV5bFiiqETmTp2PvrVugQDtGV4voHRAcbRUZLd9GDWTeyHqxHteNCXu5twSvCqEvGoGq0A5KHTCGOkqmJvIYyftxjfDl0NTj8sl+8qxPnXj076gFC/mfVv1ILGz1Bj+fYCQNHSOJJPTHFXSehHXfW+0RxW49eyDWb5JATbrDzHqaXSv3U6qk0VnEWq5bCSg0aUH6963KnN7jzMAPiRsYQSnmJvA==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH0PR13MB5084.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(1800799015)(376005)(38070700009); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
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J4iZar0N3ZddRnawOnke1+Vowki3Pl6E+SXol8PCOlpGORh/k0AaDfWIRjHqM8J1w3OVSnF/R66pAaKG20wmHmGVu24jQIQT4c1cRIHLFLeespIs0QpXgPfonDdy6CnseTljFJulLnFwaYJ+FDiMubrbIYwYFEPDmGfuwItHyozqm9R0EMgqYE3Zy277kXAS0PoAUnDAKvqwmQOacm13HfkSM7CtSh0gKfwG4Lh+XctzawWAnaGflQ5dHi71KVFjL8fpyWsT5MJi4uNHneN6/igwHPOoO78OVMPyKn5z8zczPWnQ+UJAnkiwKib39wmGbxa5LfzhwZfsGeeF5SwC92LfgGev6Z8NqKvtKl1Kt4K+y2szdEJLaxaCXnoII1qLV9X4wi9UxXNGdDbxle3HM7McmfGtnwFRivLSLp/NSLid3SrLSE8qSIXqsSMEKbpDZ/Uv8ACsVYs2hMKUjop4pJ13o6roPW/xfxcovfLChrDbCRowiDec1/CFnYnH++Zq/QNlMjBzpksVZH+nSaafp37JHdQTIdjMu5QQvYTcS4BNMwQv8wWXygXxYkl/DBXKOVlLo2O4MNZi3Sd2S6yC4oiYfIG8Dc1mTuDEhDLeWW47VL1ONKg6fx5A==
Content-Type: multipart/alternative; boundary="_000_d4b197a4dcad15d30b4aec25adbd5bb08485f121camelhammerspac_"
MIME-Version: 1.0
X-OriginatorOrg: hammerspace.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: CH0PR13MB5084.namprd13.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 22e6354b-0427-43fa-e607-08dc5f3a009c
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Apr 2024 23:56:30.2631 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 0d4fed5c-3a70-46fe-9430-ece41741f59e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: xSKQOmCM3MKWo18PTmab78LHqYPK3EuDQhQX0d8nJA60UWEy+6E5PMhOL2uWixy40xWROua4DxOmyHylRwM+AQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6091
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/cudKamYHEfWjYrise-as799MnXU>
Subject: Re: [nfsv4] RFC: New DelegReturn_NoFH operation for NFSv4.2?
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/nfsv4/>
List-Post: <mailto:nfsv4@ietf.org>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Apr 2024 23:56:41 -0000

On Wed, 2024-04-17 at 07:46 -0400, David Noveck wrote:


On Tue, Apr 16, 2024, 5:40 PM Rick Macklem <rick.macklem@gmail.com<mailto:rick.macklem@gmail.com>> wrote:
On Tue, Apr 16, 2024 at 7:44 AM Trond Myklebust <trondmy@hammerspace.com<mailto:trondmy@hammerspace.com>> wrote:
>
> On Tue, 2024-04-16 at 07:06 -0700, Rick Macklem wrote:
> > On Tue, Apr 16, 2024 at 5:21 AM David Noveck <davenoveck@gmail.com<mailto:davenoveck@gmail.com>>
> > wrote:
> > >
> > >
> > >
> > > On Mon, Apr 15, 2024, 8:06 PM Trond Myklebust
> > > <trondmy@hammerspace.com<mailto:trondmy@hammerspace.com>> wrote:
> > > >
> > > >
> > > >
> > > > On Apr 15, 2024, at 18:31, Rick Macklem <rick.macklem@gmail.com<mailto:rick.macklem@gmail.com>>
> > > > wrote:
> > > >
> > > > Hi,
> > > >
> > > > I am wondering if others have found this a pita and are
> > > > interested in
> > > > a new operation for NFSv4.2 to get around it.
> > > >
> > > > Right now DelegReturn requires a CFH and delegation stateid.
> > > > I do not know why the CFH is needed, since it seems that the
> > > > delegation stateid should be sufficient?
> > > >
> > > > This new operation would be the same as DelegReturn except that
> > > > it would not require a CFH argument.
> > > >
> > > > Why am I interested in this?
> > > > - Lets assume a NFSv4.2 server that supports persistent FHs and
> > > >  multiple hard links (as most extant servers do).
> > > > - A client mounted to this server is removing a file for which it
> > > > holds
> > > >  a write delegation and a bunch of dirty data.
> > > > Right now, the client must:
> > > > - Write the dirty data back to the server.
> > > > - DelegReturn
> > > > - Remove
> > > > because the client has no way of knowing if the file will be
> > > > deleted
> > > > by the Remove (or alternately is just removing one of several
> > > > hard links).
> > > >
> > > >
> > > > If a client is holding a delegation, it will presumably have done
> > > > a GETATTR at some point while holding that delegation so should
> > > > know how many links remain. While it is true that the unlink
> > > > might invalidate the filehandle, that’s not a situation you are
> > > > able to fix with the new operation.
> > > >
> > > > With a DelegReturn_NoFH, the client could:
> > > > - Do a compound RPC with
> > > >  Remove
> > > >  PutFH of file
> > > > - if the above returns NFS_OK, the file still exists and the
> > > > client
> > > >  can continue to use the delegation, writing the dirty data back
> > > >  to the server sometime later (or maybe never, if the file gets
> > > >   deleted by a subsequent Remove).
> > > > or
> > > > - If the above returns NFS4ERR_STALE for the PutFH, the file
> > > >  has been deleted. It can throw the dirty data away and
> > > >  DelegReturn_NoFH the delegation.
> > > >
> > > > A similar situation exists for Rename where the destination
> > > > already exists.
> > > >
> > > > I find this scenario happens frequently during software builds.
> > > >
> > > > So, what do others think  w.r.t. this new operation? rick
> > > >
> > > >
> > > > Why would you need to do a DELEGRETURN if the PUTFH returns
> > > > NFS4ERR_STALE?
> > >
> > >
> > > To make sure the client and server agree on the state of things.
> > >
> > > > If the server isn’t willing to just invalidate the delegation on
> > > > the final unlink of the file,
> > >
> > > I'm not sure about "unwilling",  but I am uncomfortable with
> > > unilateral stare changes like this, even if the spec indicated that
> > > needed to be done, which is harder to effect than an extension such
> > > as Rick is proposing
> > >
> > >  > then it can and should recall the delegation (and any pNFS
> > > layouts that might be outstanding).
> > >
> > > If it did recall it/them, then there is no way to return them
> > > without something like Rick's proposed extension.
> > I assumed Trond meant "recall during the REMOVE" while the FH is
> > still valid.

I didn't get that.  Apparently, I was mistaken.

>
> Yes. This is a clarification of how the server can deal with the
> problem (if it thinks this is a problem) within the confines of the
> existing spec

That depends on what the problem is.  Your proposal does address the problem of recalling a delegation when it is incapable of being returned.  It doesn't, at least alone, solve Rick's problem  which is that he wants to be able to know, at the time of recall, whether he can throw away pending writes, as opposed to flushing them to the server.

Please re-read what I said above (repeated here):
> > > > If a client is holding a delegation, it will presumably have done
> > > > a GETATTR at some point while holding that delegation so should
> > > > know how many links remain. While it is true that the unlink
> > > > might invalidate the filehandle, that’s not a situation you are
> > > > able to fix with the new operation.

The point is that there are 2 problems here, and they are orthogonal to one another.

One problem is the question of "is this the last link?", which the above addresses. Well.... Except that Rick cannot know for certain that the REMOVE will actually succeed. Until he has tried the operation, he can only hope...

The second problem is the question of "is the filehandle now stale, and how do I return my delegation?", which the above does not address. For reasons best known to themselves, the authors of RFC3010, and subsequent NFSv4 specs decided that it is OK to have filehandles that are derived from an object pathname (e.g. RFC8881 section 4.2.1 and section 10.3.4), so presumably the REMOVE could end up invalidating the filehandle despite the file having several links remaining. It seems to me that such a server does need to either recall the delegation, or be prepared to administratively revoke it on invalidation of that filehandle.
The gentler approach would be to recall...


--

Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com<mailto:trond.myklebust@primarydata.com>