From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B6AAC433ED for ; Fri, 9 Apr 2021 08:27:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9487611AD for ; Fri, 9 Apr 2021 08:26:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231370AbhDII1L (ORCPT ); Fri, 9 Apr 2021 04:27:11 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:50731 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbhDII1K (ORCPT ); Fri, 9 Apr 2021 04:27:10 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 842375807DD; Fri, 9 Apr 2021 04:26:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 09 Apr 2021 04:26:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=themaw.net; h= message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; s=fm2; bh= xQ22oJrPdr8ttUQBECVG7+D3ZB+31AsiXie3G3/5ob0=; b=rCQ4Ier+zYzGVyZ/ RCCR+QoLIzj06GknW577bs88qwdOaDwnaAXuWpOCtfBwdhFmxg2xkpQn6ky+K5Xz rGwmNFnnerWKgjH0qVvT8kOPHXsUu6Lf4Eg2Hwe1L7mHtx3+ACM1yw+nOwcI1DqJ sODQWbLJcyh2KdVudnghfjh5VZ+Ll+7xMMSjJuZ5lPF3HgHMo/n4sfLjuZvTgmrm muN1WpkC7OQeOy2jh7DKRKLMOUPQfiM3IMlGQrKV8pu3hBobTMDBqiw/09X1IRQb qljY83o5nWEBW5geA0u+RGsvJOmmwgYRtbqm2ghi4XNjYglt67RHsEBxZKvrzQX0 oWbyaA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=xQ22oJrPdr8ttUQBECVG7+D3ZB+31AsiXie3G3/5o b0=; b=WKQWjw930eIBJ6uU891H9a+WVjwI4Jqipx0QF4ebecw+5zY8IiyikxHXj JU3BbKIZBzdR9DfvNSjftBuW73Wlfy26yQqQ21W2A/rne/l3KvTiBHHE4bN6meMU GyOaM/hLPa9CL/EO0Z4gPY32lKyqaYJBZ6WcQw2TInGKUTvK1NEK0dTqIfpEEsXj zjpsd1sj5ktVOBu2D+c4gCBQn5/h1lk/EOKbLqfUboXEYLCCEFmwybItpwv+oeXh gT7L9uaKgS5JcCqe9GvCKICdJewo2GA7jU6gs0BvfamO1Yx4bsCY/yT+uQ8nbtLU g8Ut+LbDJbQCulnqzfE8xzfRG0Nfg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekuddgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkffuhffvffgjfhgtfggggfesthejredttderjeenucfhrhhomhepkfgrnhcu mfgvnhhtuceorhgrvhgvnhesthhhvghmrgifrdhnvghtqeenucggtffrrghtthgvrhhnpe effeettedvgeduvdevfeevfeettdffudduheeuiefhueevgfevheffledugefgjeenucfk phepuddvuddrgeegrddugeegrdduiedunecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprhgrvhgvnhesthhhvghmrgifrdhnvght X-ME-Proxy: Received: from mickey.themaw.net (unknown [121.44.144.161]) by mail.messagingengine.com (Postfix) with ESMTPA id 5B9BB240065; Fri, 9 Apr 2021 04:26:51 -0400 (EDT) Message-ID: Subject: Re: [PATCH v3 2/4] kernfs: use VFS negative dentry caching From: Ian Kent To: Al Viro Cc: Greg Kroah-Hartman , Tejun Heo , Brice Goglin , Fox Chen , Rick Lindsley , Miklos Szeredi , David Howells , Eric Sandeen , Kernel Mailing List , linux-fsdevel Date: Fri, 09 Apr 2021 16:26:47 +0800 In-Reply-To: References: <161793058309.10062.17056551235139961080.stgit@mickey.themaw.net> <161793090597.10062.4954029445418116308.stgit@mickey.themaw.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, 2021-04-09 at 01:35 +0000, Al Viro wrote: > On Fri, Apr 09, 2021 at 09:15:06AM +0800, Ian Kent wrote: > > + parent = kernfs_dentry_node(dentry->d_parent); > > + if (parent) { > > + const void *ns = NULL; > > + > > + if (kernfs_ns_enabled(parent)) > > + ns = kernfs_info(dentry->d_parent- > > >d_sb)->ns; > > For any dentry d, we have d->d_parent->d_sb == d->d_sb. All > the time. > If you ever run into the case where that would not be true, you've > found > a critical bug. Right, yes. > > > + kn = kernfs_find_ns(parent, dentry- > > >d_name.name, ns); > > + if (kn) > > + goto out_bad; > > + } > > Umm... What's to prevent a race with successful rename(2)? IOW, > what's > there to stabilize ->d_parent and ->d_name while we are in that > function? Indeed, glad you looked at this. Now I'm wondering how kerfs_iop_rename() protects itself from concurrent kernfs_rename_ns() ...