Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12641750rwl; Tue, 3 Jan 2023 18:27:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXtGL6D/MfJDuckqrVevubZA1zjJN/sDy6f0H2ZSfiB2W4d2zI3s5he6Ln9iaRIL+0pFiN36 X-Received: by 2002:a05:6402:2296:b0:468:354a:4d6 with SMTP id cw22-20020a056402229600b00468354a04d6mr36700804edb.20.1672799258242; Tue, 03 Jan 2023 18:27:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672799258; cv=none; d=google.com; s=arc-20160816; b=dwNZcbKrTyd9JkAKUcUaDiHjibj+AM3OEulq56F0JWgB8AfnaTjG4+TKgmSG9xeRt2 6Zp7MGyp9doVX1svBkglg5HX3nOjgrD4mXqhmuqkPXiIKZ8k56qXVR1VR6/8OkRYbzsb TNFvlG7kdsZuQHMlYEch/A2gUFARmP+59oZtE440naq6jBI7kd7dYcA0hU0kK17vx+m5 sbevrQRTeEfxvvuK4vwMfC+7Ot5EYRfmdMfvA88xogy6gVvnBqbg1q7FwLbMDGwKH/Rv BsXtsEnHHr0B0FpDyL4xyPcl+iI53IwrY2QlylqBgxpkwOv+gxNzSDGKxwXC06yvKLdB lEhA== 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=ENt4wz1gH2/EOWOKfDtLSEL0R+5RWadfbiqcYz7nUMQ=; b=Vfymq4q1ubFBWJr6P86sjmO3kBWWD9BVFthIllxr2MD+1ddCE1F83iKyMc++TB3xO7 Of3UNpEKHUjyebHfDQwX+boavNvi8ky3Kv4EjQ1aKCTEavaMxPZf88K8Lo7L7b10kGkZ vyycDI17e40J9KBwkoEYGxriLd7+iWEI7srvViT70njpItDqBqrYOyY/ijhQQEIwqNW+ qQZkk2nZtQbUEUDcNtZgi3AVCUrq6dUpsOO4hGILHCuEplNZA0BQj1KmhEmb99QHSGYg y2KsD3Ik1gPi/eriR7RN/7irBItIpFu3pSqg4yanaA2nExcw2FmQvVAp5F2U8xOnPjFn tqhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="2Y/XXKqR"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 h11-20020a05640250cb00b0048b0ae570d8si15262813edb.508.2023.01.03.18.27.12; Tue, 03 Jan 2023 18:27:38 -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="2Y/XXKqR"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 S229773AbjADCTg (ORCPT + 99 others); Tue, 3 Jan 2023 21:19:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230185AbjADCTf (ORCPT ); Tue, 3 Jan 2023 21:19:35 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B62E65A0 for ; Tue, 3 Jan 2023 18:19:34 -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-out2.suse.de (Postfix) with ESMTPS id 8B8AC76E59; Wed, 4 Jan 2023 02:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1672798772; 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=ENt4wz1gH2/EOWOKfDtLSEL0R+5RWadfbiqcYz7nUMQ=; b=2Y/XXKqRaIf8+3qFdk9vrww07MtdHs+wv39j+5liyVUU5YvxBU9BC1/mQEYFSvYpWil2SH 6u0i/0n6jVpxLnd2fIPqkMU942HXcAOnq9vn16t9oTgsaQti41RLIzXnhS3snObXPBQMCQ /RBiMXUh7a1oqAgHlQeLgLCSsAanunY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1672798772; 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=ENt4wz1gH2/EOWOKfDtLSEL0R+5RWadfbiqcYz7nUMQ=; b=uawty7c7wyl/N9N6GiJEFdKKKVnZWQY4iSZF5nHhl1A4GA2ujJhwwYMWeV+XfXF3B5L4Bn jf9i0SLlBLwAmNDA== 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 AD9CB1342C; Wed, 4 Jan 2023 02:19:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2KM2GDLitGOCBwAAMHmgww (envelope-from ); Wed, 04 Jan 2023 02:19:30 +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: References: <167279203612.13974.15063003557908413815@noble.neil.brown.name>, <7a98c3e70bae70c44418ce8ac4b84f387b4ff850.camel@kernel.org>, Date: Wed, 04 Jan 2023 13:19:27 +1100 Message-id: <167279876729.13974.1765446738043285170@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, 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. Thanks, NeilBrown