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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5273C433FE for ; Tue, 1 Nov 2022 08:09:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229974AbiKAIJh (ORCPT ); Tue, 1 Nov 2022 04:09:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbiKAIJf (ORCPT ); Tue, 1 Nov 2022 04:09:35 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DAF0BC3E; Tue, 1 Nov 2022 01:09:35 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A671E5C0183; Tue, 1 Nov 2022 04:09:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 01 Nov 2022 04:09:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=themaw.net; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1667290174; x= 1667376574; bh=fZsEJ7wi+HahAReChxV3837nUT/qrncYmj4vJFyeKis=; b=K FjRkr3OgjHGn+kMfurwKA4uzcb9nYif4iQjCfCcmUuut4Lwp78yZwlTgt67Y2Koh 9BTTBap0QdO+ejVgYHYUV5nJbfRvtWo9uTCI1jXt18c3Y9VqHA89SvI/oQs29mjj sDDQyAIUrYhQ5Pe8jZylkIeLXjwbCTi/6irBv1EqvBVjSQfbjYJIpm2UZW1mKcor HrQELPzNFvxKmqD613/gMVTBDBJUk3JqAl0kNeD6bd5unq3kda/FUUVlpxDoo9j3 vBJ6Z7f3au60GMHyK4D7kNKhl3yAXd5HaLeMMTlgYSAa7r2c8yxOOOysKOxp9gzp 3NRAkyjKRyUqwKaKySNtw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1667290174; x= 1667376574; bh=fZsEJ7wi+HahAReChxV3837nUT/qrncYmj4vJFyeKis=; b=t ss5KYZZHvakKZKa1yr5Qo5ZQfAd23aHXcdzzJc4HbBmDvb/frle9rjvDwExNQ/Fz W7bz9z/HgahBlqN6Obzo+6fvMtuBLgoCgTd3QHyTI8BuFRFuPb1UrOuKk/AMwh+q QIlKePG75K5bPqC9nYx0TGaIFkWQB+eGJCeI1R/P6n2QxwPPUDXB2msnhOo7qzLm SvDLEnCRXNwcpJaiVU54FseDVaqt4Lc6tHqIB0pG75j1tsAlY/9VOY+5Uzh+U8+2 IQ7KuD3YklEqJpB911bYhVQjoys/SRNs5KtnaylGx1gQSDjo4efFjXoz56uhRaPK 5CXomR462GZ3g1aJxqMog== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrudeggdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefkrghn ucfmvghnthcuoehrrghvvghnsehthhgvmhgrfidrnhgvtheqnecuggftrfgrthhtvghrnh epuefhueeiieejueevkefgiedtteehgfdutdelfffhleeflefhudeuvdefhfeghfehnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhgrvhgvnh esthhhvghmrgifrdhnvght X-ME-Proxy: Feedback-ID: i31e841b0:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Nov 2022 04:09:29 -0400 (EDT) Message-ID: <5fd7f78e-4b8f-1dd4-5b3c-e2c3583b9e9d@themaw.net> Date: Tue, 1 Nov 2022 16:09:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 2/2] kernfs: dont take i_lock on revalidate To: Amir Goldstein Cc: Greg Kroah-Hartman , Tejun Heo , Minchan Kim , Eric Sandeen , Al Viro , Rick Lindsley , David Howells , Miklos Szeredi , Carlos Maiolino , linux-fsdevel , Kernel Mailing List References: <166606025456.13363.3829702374064563472.stgit@donald.themaw.net> <166606036967.13363.9336408133975631967.stgit@donald.themaw.net> Content-Language: en-US From: Ian Kent In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 1/11/22 15:46, Amir Goldstein wrote: > On Tue, Oct 18, 2022 at 5:58 AM Ian Kent wrote: >> In kernfs_dop_revalidate() when the passed in dentry is negative the >> dentry directory is checked to see if it has changed and if so the >> negative dentry is discarded so it can refreshed. During this check >> the dentry inode i_lock is taken to mitigate against a possible >> concurrent rename. >> >> But if it's racing with a rename, becuase the dentry is negative, it >> can't be the source it must be the target and it must be going to do >> a d_move() otherwise the rename will return an error. >> >> In this case the parent dentry of the target will not change, it will >> be the same over the d_move(), only the source dentry parent may change >> so the inode i_lock isn't needed. > You meant d_lock. > Same for the commit title. Ha, well how do you like that, such an obvious mistake, how did I not see it? Not sure what to do about it now though ... Any suggestions anyone? Ian