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 0D79CC7EE23 for ; Mon, 12 Jun 2023 07:58:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231874AbjFLH6u (ORCPT ); Mon, 12 Jun 2023 03:58:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237007AbjFLHzi (ORCPT ); Mon, 12 Jun 2023 03:55:38 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 800C52681; Mon, 12 Jun 2023 00:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=H1HxyiqAlmaT/pjGlflpXqH7A85wjdG77fGIXa2INEQ=; b=rrNWN6G4fDwMPYb1CdtY5PiXG6 9GZvJhparX7QtmLlo4u/mHIKuTNcfXUi6WErhmstRR4sSqwE3PA/9icsBoAXnuvU+3EOUFKRM3pKs hLEjDtI0tQCcT40nh/5MvIOMj+FV0mH5FVTAM3VQRnPAVaSUXMBk30EEpzpVxJPpVYmmF/cqMJ3PM TZnqPgITNcxq/hi8+wSIdyfJMP2H8Dsdd/dk++XtWPYS4tm3G8vXK+8MgiIDfSTGNE6hzL10PmOaU FqHX8MQcT0O+zTf/xxqgv/i0/J/oc88m2EOFiU1wHeFuAaEHXFLCgkCRPgQ8YNTwqg0O0n/scdaPH 1JNxcjiQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q8b9s-002mmj-02; Mon, 12 Jun 2023 06:36:08 +0000 Date: Sun, 11 Jun 2023 23:36:07 -0700 From: Christoph Hellwig To: Amir Goldstein Cc: Christoph Hellwig , Miklos Szeredi , Christian Brauner , Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: Re: [PATCH v2 2/3] fs: introduce f_real_path() helper Message-ID: References: <20230611132732.1502040-1-amir73il@gmail.com> <20230611132732.1502040-3-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Jun 12, 2023 at 09:28:40AM +0300, Amir Goldstein wrote: > On Mon, Jun 12, 2023 at 7:36 AM Christoph Hellwig wrote: > > > > On Sun, Jun 11, 2023 at 04:27:31PM +0300, Amir Goldstein wrote: > > > Overlayfs knows the real path of underlying dentries. Add an optional > > > struct vfsmount out argument to ->d_real(), so callers could compose the > > > real path. > > > > > > Add a helper f_real_path() that uses this new interface to return the > > > real path of f_inode, for overlayfs internal files whose f_path if a > > > "fake" overlayfs path and f_inode is the underlying real inode. > > > > I really don't like this ->d_real nagic. Most callers of it > > really can't ever be on overlayfs. > > Which callers are you referring to? Most users of file_dentry are inside file systems and will never see the overlayfs path. > > So I'd suggest we do an audit > > of the callers of file_dentry and drop all the pointless ones > > first, and improve the documentation on when to use it. > > Well, v3 is trying to reduce ->d_real() magic and the step > after introducing the alternative path container is to convert > file_dentry() to use the stored real_path instead of ->d_real(). Yeah, that makes this comment kinda irrelevant.