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

Trond Myklebust <trondmy@hammerspace.com> Thu, 18 April 2024 15:53 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 EF794C14F6E1 for <nfsv4@ietfa.amsl.com>; Thu, 18 Apr 2024 08:53:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.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, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 7W-NShuENY5g for <nfsv4@ietfa.amsl.com>; Thu, 18 Apr 2024 08:53:16 -0700 (PDT)
Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2092.outbound.protection.outlook.com [40.107.223.92]) (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 CF942C14F5EB for <nfsv4@ietf.org>; Thu, 18 Apr 2024 08:53:16 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SLGsadaVP1Udqt4I3wmcd9aFxeYfiuRmyywLDx8kHwgaRQwQnEo764Tp3q00npQ8rqU2GEzXrlXz+n2Co4DGgrUlauyhKa6xJXW5saxeOLSRhb/8MLoKbcoF8FexkBWPsbie7VuqFl0/pqrWIb6LLZ89PWaGiFVrtevh2dEl30lpoZ6WlRT7cf96QvUIt/X18/o/WSSyzyOn6jhiwi603C9CV13py/TbmurjBW0lsvVPupmnrohNnLGTGrLPd5Tt948REQ9ZYnqL5MA2y0FzKzWPyY4gTFKAZtZQZZPlKwxO8YLdsF+pDSEF7TPTOP8agIHSyBMKAcg1noJAWI4D4w==
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=1k2ZJF3k+qi4A8NhJityff5Os1n3E6AMUvAs2Z61P28=; b=ZRrUSfY+KoK8ckn6ZBbu+CZRYns/D2LRY/uOfWFgFP79brKGC4pw11Jxi5skMhJVlUI88TT9cwIM3ozjI1XY1ao34EegHHGVDHiNtujxAbMdKfO+wiwq1ROAP//Wu54ErCjsfhEUirrjFACA/AP+Xxl85xbzwpZFF4hntwNeIPV7zRoFQDm9XnXLNt54qb7A3XJuP15G7y1jExGZafRGwrxZTR/jeFOVu6ZqG10LLguaUF0/GuOf0824/PPbQ2EhsmuxIijZBpZILsklb1+/MnKC2pDOKxh6GHR44Xy9O/L0VRm5FvxAoVhTiNKqsnDbiCVx1AN7Nrr7PRMmAXQ99Q==
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=1k2ZJF3k+qi4A8NhJityff5Os1n3E6AMUvAs2Z61P28=; b=DcNHPTg3kc1akMXHcNQ6+ylqKg9lmqHmZReMltwo+jz+2gY4Xgl7oLikCWDmUhl2MjBmsPd0KD6k3sCCv6vtVAw9wejXOWeJa+xLRbDPZS8jNN1BoeG+/PgeE/xwAEsskMQ3OXDde8PlZU1kM/9gZ7nxq66ImB235YzQ5EdKCss=
Received: from CH0PR13MB5084.namprd13.prod.outlook.com (2603:10b6:610:111::7) by BN0PR13MB4680.namprd13.prod.outlook.com (2603:10b6:408:12e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.40; Thu, 18 Apr 2024 15:53:11 +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; Thu, 18 Apr 2024 15:53:11 +0000
From: Trond Myklebust <trondmy@hammerspace.com>
To: "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/bB9rT0sn7Fq0fYAgAAdY4CAAAqNgIAAdGwAgADsOwCAAMwKgIAAC1qAgAAVnwCAAOpSAA==
Date: Thu, 18 Apr 2024 15:53:11 +0000
Message-ID: <6513a671fae58f522224fb608dd9735c2bb5ddaa.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> <d4b197a4dcad15d30b4aec25adbd5bb08485f121.camel@hammerspace.com> <CAM5tNy7cDpMd+zms1r6PjtVvZQ7LWyyrFmL6Pn_x1FkJYfPckA@mail.gmail.com> <CAM5tNy6vX6XUfwGLuOWOHWHBxhrL-Kr6Xe-OJT8hspZbuO6PRQ@mail.gmail.com>
In-Reply-To: <CAM5tNy6vX6XUfwGLuOWOHWHBxhrL-Kr6Xe-OJT8hspZbuO6PRQ@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_|BN0PR13MB4680:EE_
x-ms-office365-filtering-correlation-id: 318dedcd-8dbc-4577-b011-08dc5fbfa693
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: /9Y5wFHc2ZUZrNnroD+X2hdY8wXHvoAsfFlRhul76MPBQzVzHuUdaf9/FIQUIEi+6ubt3qCqLfsbzp3A9wqffpQ7kwUohC1hKSwXlUe6v5ZvlIylFWCQwRe97NbsiCEBC/odbwbsUMeTDKpbmyUes9UFjcT6pWH3nkBGsMYqAepShlny3a/12ko/NJsBd4eL9ohyi/bTv3SGZ4wZkO4e+aJkDOah3j64m9MJ2WUarNCttghTbXutZEIt2fTnE2oQl3ARj3J74b9ivHBhHou1I/rGXa8Vqi0drbwAZ8M9Mf2/2Z/NBfF34bk/e9xAkulfDHNEPrD3tDzuBn+g4+kbbUwj1qWtaikgNNZn0h1QNmC8ickAHSukVRx3GqQuGw9PgKeEZk885ixiLs/F7tZtl5yr1Que+HBWXe5Mm0kNqxxHQwLKRlUeiM9N3vwLVn0uxtHuke9DDWQvTU7OFRoepwHvV/QSkrqaKUzC6V1ykhrh4UIttE/zjo7YqPGo75J6Xdf6sBaKUHyIMORKPkRiz8lvpD9p7t/Jz+0Fv+NK7b0Crz5QeDOdKZwefGW5PqJuMVlTxog2aXXWlSSw+M2sZ7Syiq4ibkWkX37aWoq0HpYDe7Sq9Nmo+F2Kjh4PAICTIu5mQD+qSW7ucKMEzVu98gzwBcAR23rOgK53+anJ4zT6BOtLx9JgKvcIry5j0figYPyMTQ3usR+anM6MjRTF+vWr2hmT8QSBZrAyB+hSsYzVKMSZxo4B66x/u4YigMV4K5Wu5xkmJQmCbDpoRbEFd/xJcZL2wHQBooXDK5KfjDgCPiBZjYIYg9TVcXCH6eQS+K7JGT1TgyWpH49Dvq9Hur/suJeVJ2OIkibASWiNEdwUJxZN5s4jXhTknfqv1m17nU5hSDS+3vzW4HsRus2I0CRntq5QvkN1pGGs5Vw8Y2SzSCrECHJHP4uanSoCQ13TMQz1NJ0HMTYaZYaZqY+8zJCeA9WFTutRFA7Xx5vAwPa/XpZlTwMtjLDgVqpxoZpGQykZv4J0R0D85NoWt0n5XhLuwDSh9oHFoz6QXr0l/FzmVcrVOxG7mNTgrpCNC3Q2K07jagLt3VA6SjlUKBtCA2GS8I9gGPbCWN2gXnjLxhmqkp08xq36X9GfbvET/bwZETi/pG8gGbakWxyw5dv/EHMao7EK5BytV9Avf9PDeH7N/uI91e6Foe4N7k0h/uZykpgBxBLtVP0n/mA3npzpQ89MJys8znbHur7G3J5Jxn4IWJa7But+NVjFK0He5yNFxDU1IZPuwz4wYO7uQc6wg+q4uOEGvByQ6NuncaTJJW+dlGiwmgrQD4pupyVzXI/aqllhU2aTWLQNx18BOabIYg==
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)(1800799015)(376005)(366007)(38070700009); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: /9kFjn6f9BmzXQQehs+7IZTqKuTKduduU7y6uwFQgsA/QKs8NiRevXTRJAo7RaO+gVQ2e+aB9V+Iae8fWoWY8i+7I9rlRfX4lPrsd4SXTpe5Pur8YrHt0gf2srO2NUithSeEmfkMfkz5/660SAFpL1lNKx5+3tOJo4dRXrKOkSuv5/ALFdKrxhYHtszsn+Kh/ZIqkymqvjH5Nim3BF1K3xgdgEx0V0gFyf8UWxe1QajPCZDlw71pTxqGbWCn7qUUuxtXGobLS0QRWYiVB8t9BcvYC/7BpDpr/KcCj9iSpqCT+C0urPPjc+dVSHvKHP7UItN+baMFCa1u5NDqIKwlIYY1Tvy1FncGjYmjGMPOB5kFmJyJJ1w3098xQVAUocToCEcebv8SdKmw4nlPHnEjeosHaYY9cg74HY+En98JTzQabZTZSYs9xwcKBeGiQ3vTnJjx8DombJAM7H+UyeaWPHnA791ZT2voqVw6nHO7XUUm/zcSBgPZiNT2KtgR33IleyOO2IDqSXSQXtbi/jrxSxN8iXG+fT40oYzeGsmEMyPV7nDU0OuapckVTyvuZtX+cH6zJ9YJVt3XA/nQStWBFc2kHrQvE+aSlsLlWn3rOMJUo9XJpkp4kUFgA6I+ctNsVjZdHcuYnJmxbYZzF15z+ycRKbd8CUOJMIefIO3myYF4NdX+4BSBU8Y5B5B19wuHYjl0QsWDNMSnGr3RsYsJl63ukKPaMswyEEykCEG+8Q36Cb8/ryey00ONj5w1gPBhxltJKKXuJRxf6aamYXw6D1XscV87gIpnUXtkI1Pqod4RZhfwUknZKWtuNEtoZf6usvyoetJaxLHLPF9tBPiijn4qoFjvbQvw3c/NoUwQxIf6PhKrSLZiBtWseG13a55jT5JubG/AeDDPC1M6f8gMMMROfJTMVf1ExQvlI+rFhd0Eux99wJ5Crg4RlsryxQsYYgVxt/Hw/mu0lLsnwRGO+IT2i0E8PACEM4msXuhLikTIWvdg6XhamMBmJzMhyHz2ZYPL0e6bnE2iTurRUwq/tE4jtjFmNraqoN+SDDsjfrPNkIeGZEKFGjWD3rjCdBqzYmY+uIhHAvBE8ojZgqILNIdPh91rwtdNoCa5X36YIfDfNs4TS3yMvWS6NzKdI9+7BygYaGmFdS9ejnLRwJI3SQxfmisu/wmit62jBxeRYb6p+YFDBkdvQzVK0jPt2bQcUeYl2Q4ghjemwhuOvoHw/gR1qx3qbO0HhSB10Xb40greIeu6vl4kP7njQB4eWbpA11bQR90fu9C0Vvt8wkfW0gNVhe7ONOxuvTEjCLBTu7zBLP2cClgZOvSXo8+8oRO5pdvUVhjibFkdMmpgrVFr6LjGdHTZA9T6pBMfufp90oOVezY7Nlu4g6Q2UoUKJSdvf73t+XLgv4U/mD0xibgMSZsZojkmEgCxD9AJF7/osnxyhnaC7tHTnEtggx78vI4lCGVd1cGepMU8RqPwjEtIgKOSID6S9u0lEJlGDNuFGMjNwiYhmKQGfaI0ITegREY75R8x4pkSu73dOnUAsd3aG0hUcZ9TMiRhkvM4QIND9GIt8b22Hv7RT1a1WNUUULD8l2CWb25TQadWUCmzAisE4EstHLZ41PUTjI0iCU8ktQKD1M+TLlONpLiXd+yS/6mU4dOfjjFcB7c9I0jo1UXWLA==
Content-Type: text/plain; charset="utf-8"
Content-ID: <7FEB6AF099E32840B29CCCC806D6A331@namprd13.prod.outlook.com>
Content-Transfer-Encoding: base64
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: 318dedcd-8dbc-4577-b011-08dc5fbfa693
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2024 15:53:11.7396 (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: TziXacO2ZSiP8ztbn+hgVWuX036uQz6H4Krzmia5Ys8Q2DF88x/DvSWQcsch446kzagqOmP+I6TJWlo7jkbcPQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR13MB4680
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/HtW1LkVoCTO8C1kHv8_GqmXAhXM>
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: Thu, 18 Apr 2024 15:53:21 -0000

On Wed, 2024-04-17 at 18:54 -0700, Rick Macklem wrote:
> On Wed, Apr 17, 2024 at 5:37 PM Rick Macklem <rick.macklem@gmail.com>
> wrote:
> > 
> > On Wed, Apr 17, 2024 at 4:56 PM Trond Myklebust
> > <trondmy@hammerspace.com> wrote:
> > > 
> > > 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> wrote:
> > > 
> > > On Tue, Apr 16, 2024 at 7:44 AM Trond Myklebust
> > > <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>
> > > > > wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > On Mon, Apr 15, 2024, 8:06 PM Trond Myklebust
> > > > > > <trondmy@hammerspace.com> wrote:
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > On Apr 15, 2024, at 18:31, Rick Macklem
> > > > > > > <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.
> > I did not get this. Now I see that in LINK (sec. 18.9.3) it says
> > that
> > delegations must
> > be CB_RECALL'd (I never noticed that and assumed that a LINK could
> > be done by another client when a delegation is held. My Bad;-)
> > 
> > So, yes, the client that holds a delegation can track numlinks for
> > the
> > file. I didn't realize that was the case.
> I now think there is a glitch in this plan...
> I cannot see anywhere in RFC7530 that specifies LINK should recall
> delegations, so I am not sure if a NFSv4.0 LINK done by another
> client
> could increase numlinks without the delegation being recalled.
> (I knew there was a reason the FreeBSD NFSv4 server did not recall
> delegations for LINK. I will patch it to do so for NFSv4.1/4.2.)
> 

It doesn't just change nlink. It also bumps the change attribute (and
the ctime), which by itself implies that it must recall delegations
according to RFC8881.
Specifically in section 10.2:

   *  The semantics of the file system are crucial in defining when
      delegation recall is required.  If a particular change within a
      specific implementation causes change to a file attribute, then
      delegation recall is required, whether that operation has been
      specifically listed as requiring delegation recall.  Again, what
      is critical is whether the guarantees provided by the delegation
      are being invalidated.

The Linux client interprets that to mean that LINK will recall
delegations.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com