Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp581417rwo; Fri, 21 Jul 2023 17:41:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlH2O6vznRh7SQS/CBTpVUkdWodcwMYv7I3xymvxQNb3ZXu3STfff9xugyVUSbnek+i8rmli X-Received: by 2002:a17:906:76d4:b0:997:aee1:74ee with SMTP id q20-20020a17090676d400b00997aee174eemr2897670ejn.14.1689986492213; Fri, 21 Jul 2023 17:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689986492; cv=none; d=google.com; s=arc-20160816; b=ravKZGI19rSXZOG2yGYOHg33C6/H59LDpmh6IREQgNo5B9HgAWvlqypWFkHZjDCndp 6lbjVJyXkJUEYXOTK+WvKwBiCZDqn7ntZjqijawkRR6+OvlLNdD9MO0mLkG7mbskdAN0 4U2lO900WuI7LAgStq6ZGX4NVeoOyqnadpX3CCdkj0UiWse43UlZGiEC9g5i9wNRSdb4 I12tCTU20k3Yp2BWLY/DnYCua+B393HQc1ww3U1KRe6XSqQZ1JyUsrXfrzMsE3msN7gF e/Mcexf9ui4BHIFfytJ3rKVgbxJWRncIS6Iev/AajJAtfS88Ewyt6B509JLsTLA9tGpO TBXw== 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=qSXC/2EX9oy7Zub+xfuyFakWJVtNoucQuw1q9yV6Xeg=; fh=HM+UzgGVVPAESsuqQLUlPHJMHmtFR6rPFdd2cYesNjo=; b=rbqYG6CZ/wBKu8Wz5qxU7zxuC18WSeevglNGkFhbAGBBfGlEq6/c8e/nOmGvXkoEXn kZPuL63koRTgIqaJYXpyDsrem8/1HCYzWr/HGuiOekRjcFscvnOqSzZYbNxrRH6pb9Xq x6Qxjf40gkJi3+aAN17c5OuI+Oks7Tix+GR+KsfxN6TwEVFTd7GSx5RmROPZnjvI1def oR/WnDjKqouLAmUJIXCr/xlmyZsbL8qlqwRLaAFv29/HM1/nWgSn2d6pO9kZCWw5U1W+ IzU5xZ1LiXrZAH8ppPZgQx6M3zAu0Kgv/9K7gfz8ajcbawtbvJXQPHJg/8olx4KJwBgJ p+8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=yLqNv1r4; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 q15-20020aa7da8f000000b0051e0bc180fdsi3098951eds.455.2023.07.21.17.41.08; Fri, 21 Jul 2023 17:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=yLqNv1r4; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S231213AbjGVAeS (ORCPT + 99 others); Fri, 21 Jul 2023 20:34:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbjGVAeR (ORCPT ); Fri, 21 Jul 2023 20:34:17 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 571AE35AC; Fri, 21 Jul 2023 17:34:10 -0700 (PDT) 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 E3A7421903; Sat, 22 Jul 2023 00:34:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689986048; 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=qSXC/2EX9oy7Zub+xfuyFakWJVtNoucQuw1q9yV6Xeg=; b=yLqNv1r4YqQh6E1WAEpOgBxySH8ndFJEDsEEEvrxVszfMMm1IMVEHQ2oTH9oV9kQv1WXdV uaD3dDScl+kh7d8DBptUah4MEpmnTl3oTBzI0Wb/13XFWtoiixZ2OL/MbAgRjRT7JiTo4/ wABfVLd1kiFR5Tl/sGBaFv17sDpz/K8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689986048; 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=qSXC/2EX9oy7Zub+xfuyFakWJVtNoucQuw1q9yV6Xeg=; b=7ek051keFIYVAERfA+joxMZtS8Ghn+h7CZZXDKTAoCKKFkq5d247zVZX8Q/D93Un8XRe8i 82hlJigUlfdR9pBQ== 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 1EDE4134B0; Sat, 22 Jul 2023 00:34:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iVrFMP0ju2SGDwAAMHmgww (envelope-from ); Sat, 22 Jul 2023 00:34:05 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Jeff Layton" Cc: "Chuck Lever" , "Olga Kornievskaia" , "Dai Ngo" , "Tom Talpey" , "Boyang Xue" , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/2] nfsd: sanely handle inabilty to fetch pre/post attributes In-reply-to: <11c799a6cb0bf073dda77f592d70d809fca9b030.camel@kernel.org> References: <20230720-bz2223560-v2-0-070aaf2660b7@kernel.org>, <168988936713.11078.5407820394334916284@noble.neil.brown.name>, <11c799a6cb0bf073dda77f592d70d809fca9b030.camel@kernel.org> Date: Sat, 22 Jul 2023 10:34:01 +1000 Message-id: <168998604179.11078.18238251274062077853@noble.neil.brown.name> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,URIBL_BLOCKED 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-kernel@vger.kernel.org On Fri, 21 Jul 2023, Jeff Layton wrote: > On Fri, 2023-07-21 at 07:42 +1000, NeilBrown wrote: > > > > I think both v3 and v4 allow a reply that says "the operation was a > > success but there are no post-op attrs". With v4 you can say "there is > > no change-attr, but here are some other attrs". I think. > > > > v3 has this ability: > > union pre_op_attr switch (bool attributes_follow) { > case TRUE: > wcc_attr attributes; > case FALSE: > void; > }; > > ...we can just set the attributes_follow flag to false there in that > case. > > That's not possible with v4, AFAICT. Several of the *4resok structures > contain a change_info4, which just looks like this: > > struct change_info4 { > bool atomic; > changeid4 before; > changeid4 after; > }; Yes... I was thinking of GETATTR which reports a bitmap of all the attributes that it can return. Though I'm not sure if the server is "allowed" to not return something that it has said is "supported". And I think changeid has to be "supported". I'm not sure. But anyway, that doesn't help change_info4 which comes with directory-modifying operation. > > We can set "atomic" to false (and this patch does that in this > situation), but I don't believe there is any alternative to the change > attribute. If the underlying fs doesn't support native change attrs, the > server is expected to fake one up somehow (usually from the ctime). I had a look again at the current code and your patch, and I think that if the "post' vfs_getattr() fails, then the operation succeeds, the change_info is marked non-atomic (as you say) and the "after" changeid is set to an uninitialised value. Is that right? Did I miss something? Maybe we should set it to the pre value plus 1. It probably doesn't matter at all in practice, but if I'm right and it is using an uninitialized value, we should at least fix that. Thanks - your v3 patch looks good in general. I like the must_check and the goto structure. Thanks, NeilBrown > > We could (in principle) allow the operation to proceed on v3 even if > fh_fill_pre_attrs fails, but I don't think we can do the same thing with > v4. That said, if getattr is failing then it's somewhat likely that > other operations will fail too, so aborting the operation in this > situation doesn't seem too onerous. > > -- > Jeff Layton >