Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12649989rwl; Tue, 3 Jan 2023 18:36:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXujZ2sujQbOTTu4n3CYpcLUTvo2romSIkQmUGJddqN6PYSxgMytn9ivOrFg6qv2c8kMpN0l X-Received: by 2002:a17:90a:4583:b0:219:6619:848a with SMTP id v3-20020a17090a458300b002196619848amr50902790pjg.36.1672799801214; Tue, 03 Jan 2023 18:36:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672799801; cv=none; d=google.com; s=arc-20160816; b=mJLJ/b9r/SLG3rEeJaSnSpCN+dH7c3enPSYHsKDaYgYVknJZN2wvZkKw58geVC1MoP 1rs7cNqJIvz6OvTFH6vXMPnrNvgjLEWQdIFuPNcZ+xxxWZTmvzcMWCTjf2f/sMdGsJzO qx3yUmvKb39Y7jd6XA7aNzUi8miWepCraq3lMHqeQnL0af4mmY9LaVwasnwbqc3DqtwD wJSqxybYO5/QIj5KV4ZlZ+kXSMGg6+xW0uv4vS6YHh9KJYQrRmiaCOTbPWSEodwl/F1w SkJ8oVi8uuaJsyQ7zlZENmp1IaZJCrJZyUeKmk8SB7hmmQIdoSMVXhInFdbeVyQX6gxY SaXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=42jiK+WWdY4tsO+LrPN6GX3kbbLgCvZVMCsNu0hNRiA=; b=N7iWN614BPj1VwaeAPKDQ7pG2BFSwh6qP3HzQtiyZ972kOQ4cDsWyvpQzsFp//Q2tH ZPHtagDO1uTF8eU48LfMDqNVWxWfOCAo2gK92MJkY6444EDkD+5f/c84cKf3JLAjxY1k tBJ3gSi/LiWEIhc12seOt/ziIB7Y19YusAQcpDNZuazylCnn2f2Jvt4mskA1JpEZymou /7VHGpayU/J08xiERTWQIaSiMGfh+14ttMRZvlAo6cWepjsvYqmtC8cQjqgSVw6YNpCw B/GTYcqoqdA3Ual2K/lbNT7FsO9/y67uPYUP4tyaz7O+8K/RQCukHSR+st6ssg4XCBwU FOHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=bNrWMNp+; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=2dqPPppT; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l22-20020a17090a409600b002190eb641d3si36270930pjg.88.2023.01.03.18.36.28; Tue, 03 Jan 2023 18:36:41 -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=@suse.de header.s=susede2_rsa header.b=bNrWMNp+; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=2dqPPppT; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229534AbjADCeJ (ORCPT + 99 others); Tue, 3 Jan 2023 21:34:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233187AbjADCeI (ORCPT ); Tue, 3 Jan 2023 21:34:08 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00DFC10EC for ; Tue, 3 Jan 2023 18:34:07 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B237E37BEE; Wed, 4 Jan 2023 02:34:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1672799646; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=42jiK+WWdY4tsO+LrPN6GX3kbbLgCvZVMCsNu0hNRiA=; b=bNrWMNp+/AAqISepPaSb+XN54eRbu/cgqqf+YNXZFIaWaMdUGNniIJa7GS08qLGZB0D0PJ qI4csWCFRcm1A79t94LU97ZzPUMqrn9zpKvbAkYTr/vNyVM0bPgZLqqaxcXZ7v2p92wR8R DiSs8yH/DagWDwAqd5ziKVLN5DAgWqc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1672799646; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=42jiK+WWdY4tsO+LrPN6GX3kbbLgCvZVMCsNu0hNRiA=; b=2dqPPppTwRF1mg8GqIwGhZa1vr7oAqsuLWtBqPr7bk6F0O2D0VHKLWoC+pzdruB+IoU6/r Xh3XNKQROuIgkWBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D763F1342C; Wed, 4 Jan 2023 02:34:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id yFVlIpzltGP/DAAAMHmgww (envelope-from ); Wed, 04 Jan 2023 02:34:04 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Olga Kornievskaia" Cc: "Trond Myklebust" , "Trond Myklebust" , "Anna Schumaker" , "Linux NFS Mailing List" Subject: Re: [PATCH] NFS: Handle missing attributes in OPEN reply In-reply-to: <167279876729.13974.1765446738043285170@noble.neil.brown.name> References: <167279203612.13974.15063003557908413815@noble.neil.brown.name>, <7a98c3e70bae70c44418ce8ac4b84f387b4ff850.camel@kernel.org>, , <167279876729.13974.1765446738043285170@noble.neil.brown.name> Date: Wed, 04 Jan 2023 13:34:01 +1100 Message-id: <167279964139.13974.11763637507027085853@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 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. NeilBrown