Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13352171rwl; Wed, 4 Jan 2023 07:05:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXtxf1sLzHZFW7JS3raD+0WXOA3Q2YTJ/vZSfeDmOadE2/IOkVNILkhntjHQDpg8JOnRxjfu X-Received: by 2002:a17:907:7da4:b0:78d:f455:b5dc with SMTP id oz36-20020a1709077da400b0078df455b5dcmr50016897ejc.28.1672844727462; Wed, 04 Jan 2023 07:05:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672844727; cv=none; d=google.com; s=arc-20160816; b=pz6HpdI/aZhiy5uTgjzmSiItn9j8Si/rRzLXw+Z9C77KLGaFp/FBHeKpY9b7pmHXt/ Q+Jil/gFP3qOJLEGvIdlB60/wPG07gP/7eBrqTp88/9Iu8Z2zU5sTbm5qZIgo/kjr/oW BbEjZw9slrrj2NnCx5htrespfkOu6nedaGwcAUfHcFb69J+QcLlVWXhDmrxWoH6xMd3s d3XXunKaoeXGKzvFSQx+lf3HEsoyYenjfM7o9tzJMYtr4Nlf2i3HITUvxg1oZERZVpmz DEpghto+w1UwgEt4ZxRN9jhof4W5yrRgtA3CrRBDvi3TZ3Llxj/97mgN8Hb8omUqlic+ wVJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nfo4LMICYo7VE27iJTdU/qWYe+gy7FEaB05CsUm+884=; b=wGvmQ6575x9VN8uIt3yQqWLbmEqAZ37BrTBbfzQpRyaSalWyGyfFWPLR2k2Mf4DpJj mjqUWwYqsBXe0hn/3tliFQ+7jpy+Qwa2pee2/6J3mEyPmvllptarwpqvqRWwEQCaveDW 9vH3id1DFGetI3QUMtnjwLDJMZUsOafYRhBXIuQo0Xu2wOETSmntSmw07ebwtHRjRANr cqxszx+KJcjvG0qT6UXh8/AQhfiIl/u5Zb741yjjD4S7aABJzOVc8FMfhPy3Yq1VgxEg EgBMXyFfcfrC2/YqS1CVP+QYBQsSDMChUgYSF1xvzEDDwkzDnJhy/t63afFW/yQ4z3+Y 0NKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=WVv+7KUi; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a0564020e0b00b0046acab646ecsi28893941edh.81.2023.01.04.07.05.01; Wed, 04 Jan 2023 07:05:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=WVv+7KUi; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233514AbjADPEJ (ORCPT + 99 others); Wed, 4 Jan 2023 10:04:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239317AbjADPDv (ORCPT ); Wed, 4 Jan 2023 10:03:51 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49C33126 for ; Wed, 4 Jan 2023 07:03:50 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id b2so36115444pld.7 for ; Wed, 04 Jan 2023 07:03:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=google-2016-06-03; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nfo4LMICYo7VE27iJTdU/qWYe+gy7FEaB05CsUm+884=; b=WVv+7KUioL8Ud4s1SgmVM7AyB2CW6B/dBWWdJEQqHUDJdwe75UAR+wfnsJNl3+FGdN jwKxfF9xMXNWVcFZAe9S2b6dzXy3qTgqS68XM1suo8Zrq3KqOlrtbbUdpjv7f9NUJ0mx AsAlVXUksoHcNFcXKK4a5neR5+ViT2F/UDtIYVC1+fa7TFSzXpQNF4myFtBvm6pxXtED o3l0wgo+VOHWTo3a3ZLn1rncXro5IZrWvfAJOF2Cg7OHBpmzKOO44H3DseFkBxIa+UpC aLNDlis7oMwS6e+4oPGHH9gwnQbdIQyjflcbUzxSjQGuSl7LZEbZZNYTPfYHW7ovayWX oxqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nfo4LMICYo7VE27iJTdU/qWYe+gy7FEaB05CsUm+884=; b=iDfjomiEBMbVMZqislvkdg+dB8tUvLQBCwljIJsjkzPXfehjQGK46Uj2K6DHqam9rp fuwRk8x7UVxppd3ooTCS02p1RqSvqCp8R+v1ylCT2Atn5HkV0sSqcfeI1Y9Ch+ucWsFH 7N/GFwKo73yV1gKvpjcdiu7gJBI3meqenVZQoUcdYXepNjBDrgD9KRTDEZlompyabiEN VVRzVx9GGCCoQQEkVU4AZEXOAI1APGEAdAGwqzLUsCJXoaLVw1rugCWH4sNEf2m/iydC sukCmZemDBDhPc9uCwRP7LCBlT5Tx8EACNANthGrvJkQTQwmnMJzEubstk9SwL8zIFXi m/UQ== X-Gm-Message-State: AFqh2kr6O8eM3ZCI5N0+MKrdQ5/38rcjj3+3zeDROJPuGU79jaypBNWW tihQa6IRScBFP8tz2/wp04lpUyiwmkUKVg0XCOU= X-Received: by 2002:a17:90a:ab89:b0:213:9df5:43b2 with SMTP id n9-20020a17090aab8900b002139df543b2mr3681251pjq.86.1672844629689; Wed, 04 Jan 2023 07:03:49 -0800 (PST) MIME-Version: 1.0 References: <167279203612.13974.15063003557908413815@noble.neil.brown.name> <7a98c3e70bae70c44418ce8ac4b84f387b4ff850.camel@kernel.org> <167279876729.13974.1765446738043285170@noble.neil.brown.name> <167279964139.13974.11763637507027085853@noble.neil.brown.name> In-Reply-To: <167279964139.13974.11763637507027085853@noble.neil.brown.name> From: Olga Kornievskaia Date: Wed, 4 Jan 2023 10:03:38 -0500 Message-ID: Subject: Re: [PATCH] NFS: Handle missing attributes in OPEN reply To: NeilBrown Cc: Trond Myklebust , Trond Myklebust , Anna Schumaker , Linux NFS Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Jan 3, 2023 at 9:34 PM NeilBrown wrote: > > On Wed, 04 Jan 2023, NeilBrown wrote: > > On Wed, 04 Jan 2023, Olga Kornievskaia wrote: > > > On Tue, Jan 3, 2023 at 7:46 PM Trond Myklebust wrote: > > > > > > > > > > > > If the server starts to reply NFS4ERR_STALE to GETATTR requests, why do > > > > we care about stateid values? > > > > > > It is acceptable for the server to return ESTALE to the GETATTR after > > > the processing the open (due to a REMOVE that comes in) and that open > > > generating a valid stateid which client should care about when there > > > are pre-existing opens. The server will keep the state of an existing > > > opens valid even if the file is removed. Which is what's happening, > > > the previous open is being used for IO but the stateid is updated on > > > the server but not on the client. > > > > I agree that it is acceptable to return ESTALE to the GETATTR, but > > having done that I don't think it is acceptable for a PUTFH of the same > > filehandle to succeed. Certainly any attempt to again use the > > filehandle after the PUTFH should fail with NFS4ERR_STALE. > > > > RFC7530 says > > > > 13.1.2.7. NFS4ERR_STALE (Error Code 70) > > > > The current or saved filehandle value designating an argument to the > > current operation is invalid. The file system object referred to by > > that filehandle no longer exists, or access to it has been revoked. > > > > So the file doesn't exist or access has been revoked. So any writes > > should fail. Failing with OLD_STATEID is weird - and having writes > > succeed if we use the correct stateid is also odd. Failing with STALE > > would be perfectly sensible and I suspect the Linux client would handle > > that just fine. > > I checked a recent tcpdump (with patched SLE kernel talking to Netapp) > and I see that the writes don't succeed after the first NFS4ERR_STALE. > > If the "correct" stateid is given to WRITE, it returns NFS4ERR_STALE. > If the older stateid is given to WRITE, it returns NFS4ERR_OLD_STATEID. > > So it seems that it just has these two checks in the wrong order. Does Netapp return ERR_STALE on the PUTFH if the stateid is correct? If it's the WRITE operation that returns an error and if the server has multiple errors (ie bad statid and bad file handle)` then I don't think the spec says which error is more important. In this case, I think the server should fail PUTFH with ERR_STALE. > > NeilBrown