Re: [nfsv4] Should client issue close in stale fh?

Trond Myklebust <trondmy@gmail.com> Thu, 23 August 2018 15:29 UTC

Return-Path: <trondmy@gmail.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 8275B130E39 for <nfsv4@ietfa.amsl.com>; Thu, 23 Aug 2018 08:29:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NmEPVLV82Bkn for <nfsv4@ietfa.amsl.com>; Thu, 23 Aug 2018 08:29:16 -0700 (PDT)
Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EB4F4128CFD for <nfsv4@ietf.org>; Thu, 23 Aug 2018 08:29:15 -0700 (PDT)
Received: by mail-io0-x22c.google.com with SMTP id y12-v6so4594712ioj.13 for <nfsv4@ietf.org>; Thu, 23 Aug 2018 08:29:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:mime-version :content-transfer-encoding; bh=6K/W05Vh0blmKH/YTVm8ASJw+2DKPT8HOP1Zedr6VTA=; b=YmjsYrDdEHEqhqM1iNi/a6NCFznEWJg6QM8OzDg9yBafWe6z+tha2PBr3uxIJA9y4w eKGdfe6y9YzK1EWNPBWQ5W2MT8vAoxtMi87z6t6RXrE2E2M+XZnvIKXSfJk1MVpoQFVR 2xeqGj0iXennYQJHHINtcYWvbScjjevUsUgQzGF6LB9e9T2Iyi2XWIXFm3hosjoH8sHy zXyp+Pjmyq9hddnbo5MXeIdoeLwkQYGGyy48U6U8W/ZyqQ8Fd1tYjVuKdJLTGkLxmLZI IcrLz7SnqruPHP5WVLaTX9xyPfOCb4N72vuAWzCBr9Xvq09x5BsVBQ40DCBOpRmlm1Ri 12lA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=6K/W05Vh0blmKH/YTVm8ASJw+2DKPT8HOP1Zedr6VTA=; b=pq9ILrnFiIzfgmWJXquGTQBXwH3hprT8lf4h9XLKVOD4QA+6rkXVxThHSGnaL1Tq+t T1DU6vhyfbAxKL6diMMWKH5/UL1N7FDQKKLpjsAZLOGMRqyNr32k7KKlbi4ONeTHc3yi heNvZLaDxMmgeSiPVDhEzcdE37+3F//9whMBZvJBn0c0FWtzxVx/BvuIQuCFa8zAsUzn lzKX14HV+/QTEqMnrfwhAiuL5OiXmkhWVy6XptxXsKy7GAbK5QFiNNxa64qrgcsWvk8V pxX/humuT9I2HiLBbJto2D8UK50o0RsTSZ/TjDlEldM6lLD52SlNIussRlCIt+Zp523o 7sFw==
X-Gm-Message-State: APzg51BqSY8lhHGK+V8+laKLTDm/D1+iFNtgRv+wh1DyOwG3+qh4DRM6 2wbm+IcsZQ8ekycLpAs5v1qPoMM=
X-Google-Smtp-Source: ANB0Vda0jxVJ7//NFFYYLBGrBoeqVa3kLxUW2nHm6ZQJth2PXf4juUxJJwSw+oc4UBW42OV6utZW0Q==
X-Received: by 2002:a6b:224e:: with SMTP id i75-v6mr13626198ioi.229.1535038154953; Thu, 23 Aug 2018 08:29:14 -0700 (PDT)
Received: from leira.trondhjem.org (c-68-40-195-73.hsd1.mi.comcast.net. [68.40.195.73]) by smtp.gmail.com with ESMTPSA id v82-v6sm1748904iod.14.2018.08.23.08.29.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Aug 2018 08:29:14 -0700 (PDT)
Message-ID: <5ef4a172cda55211591664c533dc5001abe43a86.camel@gmail.com>
From: Trond Myklebust <trondmy@gmail.com>
To: "Mkrtchyan, Tigran" <tigran.mkrtchyan@desy.de>, NFSv4 <nfsv4@ietf.org>
Date: Thu, 23 Aug 2018 11:29:12 -0400
In-Reply-To: <1965353031.38280844.1535035097495.JavaMail.zimbra@desy.de>
References: <1965353031.38280844.1535035097495.JavaMail.zimbra@desy.de>
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.28.5 (3.28.5-1.fc28)
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/6gLsMl32JEid1CeTRGq6PtRKVxs>
Subject: Re: [nfsv4] Should client issue close in stale fh?
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.27
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, 23 Aug 2018 15:29:18 -0000

On Thu, 2018-08-23 at 16:38 +0200, Mkrtchyan, Tigran wrote:
> 
> Hi NFSv4 gurus,
> 
> we have a following situation. A file, opened by
> client-A get delete by client-B before LAYOUTGET
> is called:
> 
> 
> client-A -> server : OPEN(file)
> server -> client-A : fh
> 
> client-B -> server : REMOVE(file)
> server -> client-A : OK
> 
> client-A -> server : LAYOUTGET(fh)
> server -> client-A : ERR_STALE
> 
> 
> Client-A never sends close. The spec is not
> clear about it. Well, I understand, that probably
> if file is opened, then file handle must still be
> valid, but (a) this is hard to implement for distributed
> systems and (b) NFS4ERR_STALE is valid reply to
> LAYOUTGET.

It is also a valid and indeed expected reply to PUTFH+CLOSE in that
situation, so why should the client not be allowed to optimise it away?

If the server doesn't want that to happen, then it has the option of
not actually deleting the file when it is unlinked above, and instead
waiting until the client chooses to close the file.

Cheers
  Trond