Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5106684pxb; Wed, 19 Jan 2022 11:09:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzY/Lw0aDp1QjHXzw9gDynG6TtJu78SUC3EjX9w39eYkxHhL8oVP6m2Rr0miFCYZfzekudT X-Received: by 2002:a63:2c3:: with SMTP id 186mr4062593pgc.63.1642619340927; Wed, 19 Jan 2022 11:09:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642619340; cv=none; d=google.com; s=arc-20160816; b=VdpvsC8OcRAbKAdOVHAFqyTRhfJ/iwuBsjVj4lZpnf3vs5DKuITCvcdN0S/F4aJ/Bh MwrPYzgj03XnYwBJXJMxPYoMwT4mnzF8du339k/l9LDqyy6XU6liXm40PioLCc0f2nQC g/97Pc4j6hyKS7wV5hZW9PMzcwLvazE4sw/U/KEOunKy6aywysDKW9YesRwoSBx4ca3h d4oBlMV94jXDhS/S9i8bJDcGVdmZWhznvVZgnwkvPPK6P90KES64485FEA96JetcDgJx o26rlklOuggVhpjFiccrBP7GNUaXuESM61jBJR9PomNClVdnu8FYPK/EEdnhYCB4XV+a Qmvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=EY7wGmRjydi88veQTfyE2t3WaWeRPifHKDJRSG66b+o=; b=AR3dY0E4bNhhtqIbakTCg3nZ1RIPoV71C6xwOU4diNMpmr2EwuXnPVoYp/RNQUH5/T TsGPcTwtxY+TbOopHJINi0epcVtReWi6rmsuOU2pk5e1RZYjp7hzZFMQiAanMyt5PtG5 dNmQHHryKmCLTsYfm2guP2efELYlKK4QVSzuct8BXIwRhosih7fBVEv3GezfCvNe6mOd nRgg4OgOSMAfrUSKOgfHlhY14ZvAV+Q6zjE7dMD8l8/X8WNkYiMXt3dC5jBG6bDv7cd2 d1Z53ab8chO++dVxc3ukhm82IeVIXZHLTiVXFee5NaXmlT21Gvz+4JkmVRMehYVkpEH1 JSQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 17si714507pgq.415.2022.01.19.11.08.48; Wed, 19 Jan 2022 11:09:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239896AbiARF6X (ORCPT + 99 others); Tue, 18 Jan 2022 00:58:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235645AbiARF6W (ORCPT ); Tue, 18 Jan 2022 00:58:22 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA0FEC061574; Mon, 17 Jan 2022 21:58:22 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9hVW-002k2l-CE; Tue, 18 Jan 2022 05:58:14 +0000 Date: Tue, 18 Jan 2022 05:58:14 +0000 From: Al Viro To: Dave Chinner Cc: Brian Foster , Ian Kent , "Darrick J. Wong" , Christoph Hellwig , Miklos Szeredi , David Howells , Kernel Mailing List , linux-fsdevel , xfs Subject: Re: [PATCH] vfs: check dentry is still valid in get_link() Message-ID: References: <164180589176.86426.501271559065590169.stgit@mickey.themaw.net> <275358741c4ee64b5e4e008d514876ed4ec1071c.camel@themaw.net> <20220118030041.GB59729@dread.disaster.area> <20220118041253.GC59729@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220118041253.GC59729@dread.disaster.area> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 18, 2022 at 03:12:53PM +1100, Dave Chinner wrote: > No, that just creates a black hole where the VFS inode has been > destroyed but the XFS inode cache doesn't know it's been trashed. > Hence setting XFS_IRECLAIMABLE needs to remain in the during > ->destroy_inode, otherwise the ->lookup side of the cache will think > that are currently still in use by the VFS and hand them straight > back out without going through the inode recycling code. > > i.e. XFS_IRECLAIMABLE is the flag that tells xfs_iget() that the VFS > part of the inode has been torn down, and that it must go back > through VFS re-initialisation before it can be re-instantiated as a > VFS inode. OK... > It would also mean that the inode will need to go through two RCU > grace periods before it gets reclaimed, because XFS uses RCU > protected inode cache lookups internally (e.g. for clustering dirty > inode writeback) and so freeing the inode from the internal > XFS inode cache requires RCU freeing... Wait a minute. Where is that RCU delay of yours, relative to xfs_vn_unlink() and xfs_vn_rename() (for target)? And where does it happen in case of e.g. open() + unlink() + close()?