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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DA2CC433ED for ; Mon, 10 May 2021 07:21:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E57E1600CD for ; Mon, 10 May 2021 07:21:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbhEJHWo (ORCPT ); Mon, 10 May 2021 03:22:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:60550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbhEJHV4 (ORCPT ); Mon, 10 May 2021 03:21:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E9EE3600CD; Mon, 10 May 2021 07:20:45 +0000 (UTC) Date: Mon, 10 May 2021 09:20:43 +0200 From: Christian Brauner To: Al Viro Cc: Linus Torvalds , Jia He , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , Jonathan Corbet , Al Viro , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , "Eric W . Biederman" , "Darrick J. Wong" , "Peter Zijlstra (Intel)" , Ira Weiny , Eric Biggers , "Ahmed S. Darwish" , "open list:DOCUMENTATION" , Linux Kernel Mailing List , linux-s390 , linux-fsdevel Subject: Re: [PATCH RFC 1/3] fs: introduce helper d_path_fast() Message-ID: <20210510072043.lde2n3hbk7lgeddv@wittgenstein> References: <20210508122530.1971-1-justin.he@arm.com> <20210508122530.1971-2-justin.he@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Sat, May 08, 2021 at 11:15:28PM +0000, Al Viro wrote: > On Sat, May 08, 2021 at 10:46:23PM +0000, Al Viro wrote: > > On Sat, May 08, 2021 at 03:17:44PM -0700, Linus Torvalds wrote: > > > On Sat, May 8, 2021 at 2:06 PM Al Viro wrote: > > > > > > > > On Sat, May 08, 2021 at 01:39:45PM -0700, Linus Torvalds wrote: > > > > > > > > > +static inline int prepend_entries(struct prepend_buffer *b, const struct path *path, const struct path *root, struct mount *mnt) > > > > > > > > If anything, s/path/dentry/, since vfsmnt here will be equal to &mnt->mnt all along. > > > > > > Too subtle for me. > > > > > > And is it? Because mnt is from > > > > > > mnt = real_mount(path->mnt); > > > > > > earlier, while vfsmount is plain "path->mnt". > > > > static inline struct mount *real_mount(struct vfsmount *mnt) > > { > > return container_of(mnt, struct mount, mnt); > > } > > Basically, struct vfsmount instances are always embedded into struct mount ones. > All information about the mount tree is in the latter (and is visible only if > you manage to include fs/mount.h); here we want to walk towards root, so... > > Rationale: a lot places use struct vfsmount pointers, but they've no need to > access all that stuff. So struct vfsmount got trimmed down, with most of the > things that used to be there migrating into the containing structure. > > [Christian Browner Cc'd] > BTW, WTF do we have struct mount.user_ns and struct vfsmount.mnt_userns? > Can they ever be different? Christian? Yes, they can. > > Sigh... Namespace flavours always remind me of old joke - > Highlander II: There Should've Been Only One... (I'd prefer if mount propagation would die first.)