Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1948826rwi; Tue, 1 Nov 2022 01:46:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5edVgqvPgV7fUBMuD4lMZEI4aULCUARc0swLy4O29QGHHf9D8XBqMe5PP5fxFacU+fFxxt X-Received: by 2002:a17:903:120d:b0:179:d027:66f0 with SMTP id l13-20020a170903120d00b00179d02766f0mr18459202plh.61.1667292369080; Tue, 01 Nov 2022 01:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667292369; cv=none; d=google.com; s=arc-20160816; b=iPo9cXJe4ath4BB298K/oT/tqVe8mrtkQPWG73JqlKirmsKSdvZpn4F8FRH7MQdasE CID5uP6i0kei7kM05BdvYLVSBOrNFsNqELqYeaaZcPIA+CIKF646hho5x4/MQgNLXXme YAONAa6XeoBrYNi3p2nmq4WO1qIXOJJGuPNuNOV3i9Rtk9K87zBbT64HXUl75ok4Jc23 ysPMBrzyaqZy+lNzsm3XgFat55d0nOFRddXI9fg3AgCMpKuWzOXuMFY5gQBFS7Q98w5B 9809TPk5LZQCZv7XbW+z9blg1rLD8CVh1BEgE+kcphN0tfhEVCAJ5a7PqBTM0UQyqFe1 MqPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=fZsEJ7wi+HahAReChxV3837nUT/qrncYmj4vJFyeKis=; b=pPN0NqhPY1S6AKx88dO/Lt7UbTOxnMNsKSjwDmS33Ilkt2Kmyz9bUO5Zh2X1EhC9tf LU5e4bFKWMICfWWbhs9RiC77UBEoPlqAmkPp8lOYkPuMGDME204VCLExBKBkKv5YiBmN U/Enbm3m0wuc0qOr0JpG/HgXy0X+dRxBm6OnCvWAxOVUOMcDIlZxM0jBCGLa29M+caU9 yJnDBNyX2N5beqTFUac8Jx8GlDahd89UwtKP2GpNIzVYy23/PuLylvENvrhQkRLA3SIR L0A5Cg7N9Phpj7g/g24b2x+uqUtnkuwS1nG09Zhl5ZT9re1bxZ3J1eHe3Pf8CBxLnDkn iI7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@themaw.net header.s=fm2 header.b=KFjRkr3O; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=tss5KYZZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r13-20020a170902c7cd00b00176db49b734si10000428pla.283.2022.11.01.01.45.56; Tue, 01 Nov 2022 01:46:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@themaw.net header.s=fm2 header.b=KFjRkr3O; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=tss5KYZZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229992AbiKAIJi (ORCPT + 98 others); Tue, 1 Nov 2022 04:09:38 -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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE 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-kernel@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