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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A524C433EF for ; Wed, 29 Sep 2021 22:28:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CD7A61269 for ; Wed, 29 Sep 2021 22:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346691AbhI2WaB (ORCPT ); Wed, 29 Sep 2021 18:30:01 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:58563 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233018AbhI2W37 (ORCPT ); Wed, 29 Sep 2021 18:29:59 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 214FB5C00E9; Wed, 29 Sep 2021 18:28:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 29 Sep 2021 18:28:17 -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=fm1; bh= RbGSPlaIqE0tLsEJBLRO6taLWZBMOszsIYdAAt8k7wU=; b=aNRDdpAiuUudGwPF hJ6KGND/HIU0vfe4677Y0dhl/XTuHawULRt5xHsxajJhRY0GrlzfHoZku9CyUhdS rtQRdqAGx3FX0jDzXxoDOi2iZ/o418kS6YuUrnREYBGjlrRVEAnJS5oOGgx3oVhd NWEZQYsrRmWKaqW3ucCj2w3YHY4Ob6BD3+OMWtIxLvAxfZTUPV3aC8r6xt3po2IT VKk7SbMdeJPLcy6vcYnNBkgLLYmiIKFc/8S5G1HDaXA5Cjt6dcPYCQbgzl+4VVGR LtkRiOKtk846AS+MLYx21RWGrjb+mEilgae16yqFNRNWwuaUytS8pmdpjFlWpQlM CpzqnA== 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=fm3; bh=RbGSPlaIqE0tLsEJBLRO6taLWZBMOszsIYdAAt8k7 wU=; b=FBoFQ3vHs/BeHpb1aZj4/5L3FoWUGuhmmTqIqha71qQR3jzZqIZoSg2OQ 9mowR5tePMDfR6CRXvfKXtwncAD9dVvVGuwRkzkUimyUyayfpaC+Gda4Fo+Ju0zA HGXIBhopllgQ9Z2XqUDnizId70wTJoUKJ6n+dFwXhL697wpsqmxMNtrxHWRX5iiQ AMTh1Zcmqg5pCNnp9T9adq3QwIbyPTYHZOmopZsAhrL8DcqxO9EdFbZr3ticXC0g btJ+c7hfrsISlBs/v9xngfJCpvW41dBsIMlmG7LnWp1MdrtMDdoqLM70Vk9fVxwF tuF5+//prsjsL/m+lUsXSxnHg8mGQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekfedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkffuhffvffgjfhgtfggggfesthekredttderjeenucfhrhhomhepkfgrnhcu mfgvnhhtuceorhgrvhgvnhesthhhvghmrgifrdhnvghtqeenucggtffrrghtthgvrhhnpe fgleelkeetheelgeehueejueduhfeufffgleehgfevtdehhffhhffhtddugfefheenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrrghvvghnse hthhgvmhgrfidrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 29 Sep 2021 18:28:12 -0400 (EDT) Message-ID: Subject: Re: [PATCH] kernfs: don't create a negative dentry if inactive node exists From: Ian Kent To: Greg Kroah-Hartman Cc: Tejun Heo , Hou Tao , David Howells , Miklos Szeredi , Rick Lindsley , Al Viro , Carlos Maiolino , linux-fsdevel , Kernel Mailing List Date: Thu, 30 Sep 2021 06:28:08 +0800 In-Reply-To: References: <163288467430.30015.16308604689059471602.stgit@mickey.themaw.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-09-29 at 08:05 +0200, Greg Kroah-Hartman wrote: > On Wed, Sep 29, 2021 at 11:04:34AM +0800, Ian Kent wrote: > > In kernfs_iop_lookup() a negative dentry is created if there's no > > kernfs > > node associated with the dentry or the node is inactive. > > > > But inactive kernfs nodes are meant to be invisible to the VFS and > > creating a negative dentry for these can have unexpected side > > effects > > when the node transitions to an active state. > > > > The point of creating negative dentries is to avoid the expensive > > alloc/free cycle that occurs if there are frequent lookups for > > kernfs > > attributes that don't exist. So kernfs nodes that are not yet > > active > > should not result in a negative dentry being created so when they > > transition to an active state VFS lookups can create an associated > > dentry is a natural way. > > > > Signed-off-by: Ian Kent > > --- > >  fs/kernfs/dir.c |    9 ++++++++- > >  1 file changed, 8 insertions(+), 1 deletion(-) > > Does this fix a specific commit and need a "Fixes:" tag? Oh, of course yes, apologies, my bad. I re-post it. Ian