Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3135130imw; Wed, 6 Jul 2022 18:30:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t5kDWIrhPR/NdPBf4yJQrtgrYIIjTzBDZW9uUf8R7uG68cZVH5PFtx7MJLAZs5MSLg2rPa X-Received: by 2002:a05:6402:5288:b0:435:ccbb:2a3a with SMTP id en8-20020a056402528800b00435ccbb2a3amr59665480edb.382.1657157414319; Wed, 06 Jul 2022 18:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657157414; cv=none; d=google.com; s=arc-20160816; b=BdgL1peNsH5Mu7JiBl2nDkfW87Sv39rv5AfOrtAl0CqvPb7MdHXavUa7LffYXrTuOw qB95Zjtgvnfodndgr+kzF/TPOKxCU33J/E8iFbWK2QrpQFpL0NJcBiMhrgxAAMKFYQGn a0gq5n9uDNwK/u6a8k3BW8HsrgvZGWdSYBR1a/ju6CW5Fw8J+54mG8TAa5YZEliihABl JrAI20AcUOgwh3UFgc19H6XRukkq3jGFk77CDf//gKvx5H/8xrZnwa7GoA7J6qVBaOaa IWh+9Em49uc0xsT+22iL4AfiPS4LBqACFBWtEFMZO8QFCM0IxfWi5ykjsRaz5wdaF0Cf A2tQ== 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=Qtsm/K1h5PZBqZjmrEGM5MtAPPcdGp/Snt0jKIWeJ/Y=; b=TvLEQV7v9Hepy+UC+le34752DcuroYrqdcUdADqgQvnNsrlUeiD/mImqsRI56eV0dG Iv3LKGeuh5wadCqbWd5cNbR5yyoQBVuR3yllfg45RAKw4xhukjkJnObr4LshTPiNKgdY XBox1fi17RKMkFGNIr7K/bsbl7RPN/2XszwOmsEGlOMtWv0JBdI3Pl95cEMmz5umSyv2 i5/uGh/eX4e5ZYfV490MYyyga7XMEw3FTcis4DEwpCYxH1Ec21A2WK60j00OsADNpsG1 s9TJd+j7Q5H5sCGK7QEspa57/GQgxF1VnnaFow7HMW0GzTYyZVDvTnNOrpouDT3lHoBw KDRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=mX54W19g; dkim=neutral (no key) header.i=@suse.de; 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 y23-20020a170906519700b0072aebe66dbfsi7203956ejk.300.2022.07.06.18.29.48; Wed, 06 Jul 2022 18:30:14 -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=mX54W19g; dkim=neutral (no key) header.i=@suse.de; 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 S230401AbiGGB3T (ORCPT + 99 others); Wed, 6 Jul 2022 21:29:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229869AbiGGB3S (ORCPT ); Wed, 6 Jul 2022 21:29:18 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC5A22E6AF for ; Wed, 6 Jul 2022 18:29:17 -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 970B322197; Thu, 7 Jul 2022 01:29:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1657157356; 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=Qtsm/K1h5PZBqZjmrEGM5MtAPPcdGp/Snt0jKIWeJ/Y=; b=mX54W19gxP9XQ4/tSD1CxIfHar0XP7PXycvCaRAmjPEVetHCo9Gdk8jMd6z7SLklDfxWOZ CO3VJRUpDisv11aKjx42mpyQA6/65Q06linF197cjXJW3n9ditxhwUndOGdcVtciM4ocVL /hmTOt7DMGP5ciPEET8n1koSM2BlgtA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1657157356; 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=Qtsm/K1h5PZBqZjmrEGM5MtAPPcdGp/Snt0jKIWeJ/Y=; b=V8cmemxOzERFQRPBvknYbAf5S5qIODpo7/CYqF39XBOZJNTkLjq9rKJp75yYhwlW/nG42p omnsuwN9njxHtFBQ== 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 70BFA13A7D; Thu, 7 Jul 2022 01:29:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zK/QCus2xmIGYAAAMHmgww (envelope-from ); Thu, 07 Jul 2022 01:29:15 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever III" Cc: "Jeff Layton" , "Linux NFS Mailing List" Subject: Re: [PATCH 5/8] NFSD: reduce locking in nfsd_lookup() In-reply-to: <0A6DEF8A-232B-45FE-8A45-C403DE4E4342@oracle.com> References: <165708033167.1940.3364591321728458949.stgit@noble.brown>, <165708109258.1940.1095066282860556838.stgit@noble.brown>, <0A6DEF8A-232B-45FE-8A45-C403DE4E4342@oracle.com> Date: Thu, 07 Jul 2022 11:29:09 +1000 Message-id: <165715734903.17141.8779762171235676843@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,T_SCC_BODY_TEXT_LINE 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 Thu, 07 Jul 2022, Chuck Lever III wrote: > > + /* We want to keep the directory locked until we've had a chance > > + * to acquire a delegation if appropriate, so request that > > + * nfsd_lookup() hold on to the lock. > > */ > > status = nfsd_lookup(rqstp, current_fh, > > - open->op_fname, open->op_fnamelen, *resfh); > > + open->op_fname, open->op_fnamelen, *resfh, > > + true); > > + if (!status) { > > + /* NFSv4 protocol requires change attributes even though > > + * no change happened. > > + */ > > + fh_fill_pre_attrs(current_fh); > > + fh_fill_post_attrs(current_fh); > > If this is really correct, the comment should also state that > no concurrent changes to the parent are possible during > the lookup, and thus the pre and post attributes are expected > to be the same always. The earlier comment notes that nfsd_lookup() is called in a way in which it takes and keeps the lock - that should imply that no other changes can happen. But with such insane looking code, it doesn't hurt to be extra explicit. > > Otherwise, this code paragraph looks just a little insane ;-) > :-) Thanks, NeilBrown