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, URIBL_RED 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 4F142C43460 for ; Sun, 9 May 2021 02:29:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2006F613D9 for ; Sun, 9 May 2021 02:29:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229696AbhEICaH (ORCPT ); Sat, 8 May 2021 22:30:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229609AbhEICaG (ORCPT ); Sat, 8 May 2021 22:30:06 -0400 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 11234C061573; Sat, 8 May 2021 19:29:04 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lfZBA-00CpvV-0M; Sun, 09 May 2021 02:28:24 +0000 Date: Sun, 9 May 2021 02:28:23 +0000 From: Al Viro To: Linus Torvalds Cc: 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: References: <20210508122530.1971-1-justin.he@arm.com> <20210508122530.1971-2-justin.he@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sat, May 08, 2021 at 03:47:38PM -0700, Linus Torvalds wrote: > On Sat, May 8, 2021 at 3:42 PM Linus Torvalds > wrote: > > > > But your READ_ONCE() is definitely the right thing to do (whether we > > do your re-org or not, and whether we do this "prepend_buffer" thing > > or not). > > Oh, and looking at it some more, I think it would probably be a good > thing to make __dentry_path() take a > > struct prepend_buffer *orig > > argument, the same way prepend_path() does. Also, like prepend_path(), > the terminating NUL should probably be done by the caller. > > Doing those two changes would simplify the hackery we now have in > "dentry_path()" due to the "//deleted" games. The whole "restore '/' > that was overwritten by the NUL added by __dentry_path() is > unbelievably ugly. Agreed. Re READ_ONCE() - we are wrapped into read_seqbegin_or_lock(&rename_lock, &seq) there, so it's more about being explicit than about correctness considerations.