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

Trond Myklebust <trondmy@hammerspace.com> Tue, 16 April 2024 14:44 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 B0F8FC14F71E for <nfsv4@ietfa.amsl.com>; Tue, 16 Apr 2024 07:44:13 -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 ck5mkO02Y2FL for <nfsv4@ietfa.amsl.com>; Tue, 16 Apr 2024 07:44:09 -0700 (PDT)
Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2128.outbound.protection.outlook.com [40.107.244.128]) (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 87D32C14F71D for <nfsv4@ietf.org>; Tue, 16 Apr 2024 07:44:09 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PGv0+WDRSC1Ox3njyk6HlJrHbIJDONv1Mxovzx0uZO0Gdim8E46B7tIqmDIEb8fWV1v44UL4DPYf1mayR0ESEfO5cwWiYlPCMEQe1cow/H9HO9NE1JHlHZ7FuN4q3MnF4GjlU6mFliGlYaZn7NLlVWNF3preJEDhD6cSlUKRidHMZYrUAX2yv9Z5oaT8YOfEAk/0Xfk8pwzVHm3JiTbFdZ/Oj1kaGFXxZ6dbaHDmdHmefDY3T0aX63Dy0tj8+LDyF52QR+tGpfiV9Bkb3r0U3UzBeKfMuOUUf5/LpadKkUzGlJryO1Mrt+fB2LiE4i/L6XZwfencKEfYaHSBq5pJvg==
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=UkU1cBBM2Dr3NO7O+X6UAqarHvh9sotdv6Q/+QigzpI=; b=Jzq94okN0c3AX/HpIJKjAq8vm1nrZGVceAmc4vemDzekqeXwDAc0dmUvIC2aW2mQrG3YPyVM9FaS+VkgiVwdCwRoZw9qrh1SeMFoavkKESc6PuJuAnHuwWg37Ija15gqryAmMfm7cFwrbqjpXKflzA4bvLNUpDQBVrTr4QULVJxtDOWajmE0rgr+BLtw9euyeXL2W4GxLBKYn1jZUzINESxWmgyLmcxOxP38FlZjCH138/Nug6vH7sFkjXAsnqsjyina/Go0Xof8FxTYhbl8GjiC6ylWgwGFW7vtp+uBkjq80qDCskGE44jzgiBhR14MFj6OT0gOxCKtVcAFxlSTRw==
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=UkU1cBBM2Dr3NO7O+X6UAqarHvh9sotdv6Q/+QigzpI=; b=MyGNBkQuU0yaYsL0q8vCCp+gP3e/96qhetfZ97i0dipnARhKnwanmBzyZEXv3or1gtFmrk6X38bbVfF1LVVfSqlgI+0q1R+0epJl8agf0RiDQJWPKML1jhfkAhtttO3+J/WwKFir1WAVrQ2KyewUcKAo+HgPQfg52ceBpWo9Dzw=
Received: from CH0PR13MB5084.namprd13.prod.outlook.com (2603:10b6:610:111::7) by MN2PR13MB3838.namprd13.prod.outlook.com (2603:10b6:208:1ea::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Tue, 16 Apr 2024 14:44:02 +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.7452.049; Tue, 16 Apr 2024 14:44:02 +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/bB9rT0sn7Fq0fYAgAAdY4CAAAqNgA==
Date: Tue, 16 Apr 2024 14:44:02 +0000
Message-ID: <adc3fb5ed3674078c64399b19891c63b7a1185e4.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>
In-Reply-To: <CAM5tNy6-ADHC1z9HJME0r5o-hDeG9OucE_SWftDrqE4JnMrhAg@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_|MN2PR13MB3838:EE_
x-ms-office365-filtering-correlation-id: ae302905-3e49-497e-c7b0-08dc5e23a8b2
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: VbOM/b/7zrcEQQUvEyoM0Mq0wh23daczFlXADmRd1gaxRdgn4ksvEpoaUXegNSR2gbqmZmVC7zvjAuMcHXc2o9cMDEAUqXhjDuzmNOFG9dTp46HAaYubSPb6BpuFZfdqXtAiLOQRZlwuxwohdQ1X5HlE857KLtaILAaRMPlZwHthx+DqezypkyDtDcRKnarYSsXEeMxTr9pHekDWBctc3WMWQtDkF8N6Wey/gMvumQ2K9Znq1FDoNGncJGFCsmLFZuGEKqCLSQ5qCj4DtTOm/PMDO9NCNURCQCNn1ICtKxYFv2MrgVz0uIVPiAgjd2oPzzZlAW3n99R7kVPh39/dBKQBnQjfa8emK/tNvOrBtx/JZvZ2TuW23za5UKA3iv7n4L12WgmBneH77vD7EsU9X8wOzPdckx6jux+oyymRxNh5f1UBuiMnRcEF11ZZ/eXysBb1+douXVu7qOWMnbB4Gn7iwh6pCipmIXQC+Nv8DUn1wQN/IyZJnp2Zn89tSv8pZaKQBYfWb6Rg+II2Mp+31GZgY4AovJYQkibpMsPlPNhQCioI9Ki6vWmeDyV60LtY6dWg18GYD8lX549mJbj54Go/K6xfSRRDzHv+dvlV/9X0elvGN/TspWrYw/9R73iJpivHyVH71ilWxzNbCtaQd+WzX38LGDboWyhO9d1fY6ja7aupSHqaWBCqK+DOolBE06xi+FAMkrmV6cL+j2o65XUL1+aUSMYU5pbsTWdycJ0luhFVETrJrhsPGCwFCjiHIwWLTES+sjCuojDFG6WjQorjQFLPATfwC8/GyzBG/AxFVZmjiC2MOsZfs3MTzMdyt5SeBaCzyl+KHoZ2iGLGLv7Q2w499Ahjmv9CIg3iDgn1uKzuf9xZ8aNdkw6P/9mm2sBV/O1r3T4n4yHvBomKTxQjS6OPvLNy4SLMv8BrPZyqisoTmtqDYg+RWXelJG6KQ4hOi5CTJeMT8nbWP2tyTjMBLoJTT13ff6ZzpxBMpDBnBsPxy/+kfmvMtiiHho8o3WL+iBqVucXTtsXgKYaj+r+aOO47P1Sd2veBWUJO+VJuW5Fq1G1WCmEE8Z1rB6+Je/HjhrwjKkETrpRh+rgZPuycEoJFhZcfaRaFe0zT+QJ8PYHjS5q4uTIg+LUokUHE7NcFTKzq8dQoos7N9eT51ZqvTkKCuh3Q+Ap3RkWD0zzqOAEaVU5cCcdB9T0IK2HbjXd0eD3Za3NO8TnZg/Y47wykR5mcMU0Jw4bKI7zSVN9XsV+4uxvuU8Z4aCqbCWuXbUAELSkUwl5CDLoKBxZ7bjDdRg3rdxhUa7TCiY04y5EjozF5qb9tBsQpVvFuYuU88T65pA9hxOyMViqZDQxBoA==
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
x-ms-exchange-antispam-messagedata-0: D2/J6QM4UmlH6dzXr5ysGG7kk7vf8voQnyURDF1XpQKW8SUMFusH/pEVpsC37P/ZBHeb8rk1kgkvHPm9BLDRa3iB5+95XHKnqgKn/QIpv6t5wIsR2/sfG82uEnZh97biGRHwCLNgoHryzWPwkiynAl0pISXGxyTs5I7eSjnS2bf5Rr5V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GuUjoZT/PI7JnoffwS5beJh9eeqPp/rrlywcWUL6uWtfZKCU/YBjDPe79gp0OPUKoX22SzyXCPg/e4am3lObZ3btpcwyt5bhmWYbsskQqXCSlGQHsNUD2ZmC9dapBW6a0xUBlZkFxIYfn2M1HS7HO17I59YhfTLarcgU0THRZnMe28uA/k/Z/pZHcANMBONG/4J9cn19Qr10yvDPONLaCcbn+BjnuWRpE6TVNfPdutB1A4dhWR9wlEVvINHi6GQx0SRzFdBd8rRYf/fG6wFuhRsK5XvcMUcIflNH/fZ4Y/UX32yxUX2erFF34Yp+fdIRHrZOx+Sbn86BwJjW3DFjfZ6ATgv2UHOITnyPaCwZFa8HQt5co+Yylqujz1X5pxj2lXaKAsFXx7iKc06oLB0zrMAhNj+Y9/fGj5lqihu4rZ6niEH2cdw==
Content-Type: text/plain; charset="utf-8"
Content-ID: <2CD37C0AD06F504D9C52C51269F1D94C@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: ae302905-3e49-497e-c7b0-08dc5e23a8b2
X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Apr 2024 14:44:02.6552 (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: 9L2+Cr+lx4FjMAbDYjEWb7Ktm82G/4XnysFZP7J5EaEYqK/8ioL7ltXBd8omhDPQv77NhpDkDXkzmB0xXZCfYg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3838
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/q22YKzpjUpUE-FdcXN8BTt1pRa0>
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: Tue, 16 Apr 2024 14:44:13 -0000

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.

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.

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