Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1476595pxj; Sat, 8 May 2021 19:29:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMg23lWVV8WzI1zE/694Abdzgg2b6OIgk7gjIFTf9S88/Aa8SLYHtydPJr7+W1Kvx/n5Aq X-Received: by 2002:a05:6e02:eac:: with SMTP id u12mr16188537ilj.177.1620527391774; Sat, 08 May 2021 19:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620527391; cv=none; d=google.com; s=arc-20160816; b=egdIg9qtDIH2D4l7tz97r92UFPM3jPtniS4rWxRWfbfeJP0xGo3LbErE6SZfUSWVgn 9dESBeeatzzhEF8yutG5gch/8L5ykWg1WM5uz4NBeyGPuRn6TV4fscIhG/WCDhSLIcdJ tXmCcKhyZF8MGXfsVPocNOUCfdhvIk2Ug1CLK21xNfQeKts95TOKkEhDIH8vtO9YigYy 6y5Ycod4xAI7dTtpoeTiXOzIhJUT+46hgFjhIHfpFTXu3jIYzT8aOqlEPYKhEg9vXtT6 JQY66gq80TNJiREAX+k3/Y8Vwv6rpmjJto2ihK9ZB3pH/fRUlX5dgYzLGyKIo+FSo4BI ka4w== 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=A14aaAl2bgMe2AhPGLDE87jFVKfdrhlanmW+7x+UKdI=; b=IWd1hEz4xjyqO6rb9IkY3dubcKCNVEG6FQXKvGYdcVj04mBea3vNHpX19Ia+DwP4DP b+mgf15Y1WOf59wJ2E8x2UBGSmTJ4WHwHmC3O72yAP28qPgatfIZu5KY9sr91bSYzT2q qbiA6U5M7bbDtU4IF3wfT+rvoMMy94rUl97+LFZytKkG3XSaM8l7b00PW6ocOkBVAe9e RcNK15qtmrBDRblhXUtDOQjp7AtIQMnEbnTXE8a9fMt1aXpkN1Nh+8v24oSoNZnRCpVI uR67Lm0C+O2thr5y3u2HKcYfNsR0cYEV2dO0+cCocZRm5NqmqSiPLs693fLqneTmyAfN fvBQ== 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 l3si7296378ilo.32.2021.05.08.19.29.39; Sat, 08 May 2021 19:29:51 -0700 (PDT) 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 S229699AbhEICaH (ORCPT + 99 others); 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-kernel@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.