Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2772219imw; Sun, 17 Jul 2022 16:50:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uweB66sSnX0X34Wgc0ne1G05JAxjCmllv7RhvyGhCDm/kwD9hhkjHKRPM2iUP4xT89om8x X-Received: by 2002:a05:6a00:2282:b0:52a:e79b:16e4 with SMTP id f2-20020a056a00228200b0052ae79b16e4mr25364263pfe.79.1658101801557; Sun, 17 Jul 2022 16:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658101801; cv=none; d=google.com; s=arc-20160816; b=z3SwofKnmwSAhB9I9frifNtRI/XzEV6KGac9KXxnO9tAhgqpFR/4bmMvqtp1zjjR4/ INF1jIincBT0Io4PLdRY3PHe/fU0OlZCrh6XBLonyA47bo0Sz2ax2U727SM0SU7G53i5 l29zVp+jKzId37bK9NTei+Ibdr1xvVJSUUtS7p0pGWOvcK0jZ8iQYGnWX6O3Y8hjpo97 53dNXyo8N4McwLLS8AiOaY/0Y8O2HYRrRY2aphKxoFxyQzojUSMWpWR6b70Mwy/i87C/ 7vicRMIMSntyVUhfWNaP+4ET7Vn+PqcLNdi2SqdhxyEVvm8tVdYKnfDGyEKTKdwmjTqR gUhg== 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=60hnwigijFY6j6ZnJkmma7gV/Mat3FSM1juquE1vQEg=; b=JtzH8KCCAnZqdghnYOEexRPWoVcop57mUCCgqb4FoDeqzFr6EC0IiC5+jNdVrE3rnJ DDYJnwuCMIgQJ8q1Q8pkrz3AYbVXohw61D0fXjyXprRSvtoyhJapZBCBYqoXKfC4fkpU R0UyLi7NhwUNRJgO3gaXzZsSo0/XiMWUCoKnBbF5C1Gb7kWodGDAAZotNPTNnqjNJw9R b5wgfLCkPzWU9s8e+KeUYR7ndIkoNBM3WeVPmsPUHuOpPtAYpfBuIK0PKwT7McMQJ4Fa Y645VPhl5AQV6UDAwo8Y2+PoiB1GPhe/HlYYQXAeb1R+tjRmDLvaLA8DcV7sMSv00FCY bfuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lAnBy+Db; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=sVjxDKEX; 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 b19-20020a631b13000000b00412a55c0a93si13419016pgb.136.2022.07.17.16.49.30; Sun, 17 Jul 2022 16:50:01 -0700 (PDT) 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=lAnBy+Db; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=sVjxDKEX; 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 S229573AbiGQXn2 (ORCPT + 99 others); Sun, 17 Jul 2022 19:43:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbiGQXn2 (ORCPT ); Sun, 17 Jul 2022 19:43:28 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAB6DFD1D for ; Sun, 17 Jul 2022 16:43:26 -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-out2.suse.de (Postfix) with ESMTPS id 07BA520527; Sun, 17 Jul 2022 23:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658101404; 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=60hnwigijFY6j6ZnJkmma7gV/Mat3FSM1juquE1vQEg=; b=lAnBy+DbafXOKLCIWbvVjEy+qi3hKWO4P1uh3PJeL/HV6GPiCUK5STD7AbzJuPnKtKKE/c T+akyIlemQSr/crz+8vcagVcZ5hBR2wcoU3VuWZ+MCmT4Tfzs+BUHL1bJJ9PsP2ORltiya LAsumZpLgcNKddT/D7vinopsZ5VKgF0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658101404; 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=60hnwigijFY6j6ZnJkmma7gV/Mat3FSM1juquE1vQEg=; b=sVjxDKEXh2zKa69Mf9M8b8PIVKQxZ3svMAPclDqG+Mj2LPaTqQYtpQ3edMpQLJipLdMfj3 aB1dEv0dIR5yCmAQ== 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 D501313A89; Sun, 17 Jul 2022 23:43:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id nKYoI5qe1GIGawAAMHmgww (envelope-from ); Sun, 17 Jul 2022 23:43:22 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Jeff Layton" Cc: "Chuck Lever" , linux-nfs@vger.kernel.org Subject: Re: [PATCH 6/8] NFSD: use explicit lock/unlock for directory ops In-reply-to: References: <165708033167.1940.3364591321728458949.stgit@noble.brown>, <165708109259.1940.685583862810495747.stgit@noble.brown>, Date: Mon, 18 Jul 2022 09:43:16 +1000 Message-id: <165810139630.25184.17789001759725189604@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 Sat, 16 Jul 2022, Jeff Layton wrote: > On Wed, 2022-07-06 at 14:18 +1000, NeilBrown wrote: > > > > + fh_fill_pre_attrs(fhp); > > status = nfsd4_vfs_create(fhp, child, open); > > if (status != nfs_ok) > > goto out; > > open->op_created = true; > > + fh_fill_post_attrs(fhp); > > > > /* A newly created file already has a file size of zero. */ > > if ((iap->ia_valid & ATTR_SIZE) && (iap->ia_size == 0)) > > Should the fh_fill_post_attrs call be done after nfsd_create_setattr > instead in this function? It seems like we're filling out the post-op > attr here before we're actually done changing things... nfsd_create_setattr() only affects the newly created thing, so it should not be changing any attributes of the directory that it was created in. So it should not matter for correctness where fh_fill_post_attrs() is called, as long as it is between nfsd4_vfs_create() and inode_unlock(). I preferred closer to the former. Thanks, NeilBrown