Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1491374pxj; Sat, 8 May 2021 20:04:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgGuxKaCHtSlN83Wf3piOOtRe3Gd1UhwZZlXO1aGp7ZNKXOVzk4m9P6R3edSX1eNBc2oBE X-Received: by 2002:a17:906:8588:: with SMTP id v8mr18391219ejx.550.1620529453636; Sat, 08 May 2021 20:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620529453; cv=none; d=google.com; s=arc-20160816; b=gWNpRAa2zCvxHnOx39DHzTcv9YTOuzrJDd5sZseLXk7BWkkSgce7FNs3YeUXGYq6bz 7DKvb1rFiGd2nKTPsi6smFtl2tro2B8M1x4SYUVyUGibaOnIkKTxIxAvFHG9I4Ys4KCk cHFzJm3+uWPW+2XcXiQfaEDk2mD19XewAjDdIfKy3K5/m0TgIds2TGwInWccyMzdi1cJ sqgd7dtgafr3gHv6vPfLilAcMyVkF3SYqgb1TsWtLhrIl7N8UC6kzz7as/f65RcbwASS YAgeVPW7kZFQizwIS5zRJxYVRip0J8xj8+HqfIxlcVfMHq8KFi5KTFCVtdyXsv1x+/oI 2SMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=c00F5gdQd8J96Q6xsAfPKXtIOJ12DymA7I1VC+ABJMI=; b=ExK2apSaHaZ7P9Zgl39jFiCKAZwkP3aq3ZgRxHNPsLJoHsR6RTWI0pmX798jQ0YBX6 7EH/FTT+GbVyDcrQUUTbCKHA/uB4qiYhuOYiY5wehlwnfObWgPVFdY6z/HFTiT4x2SJG CM4QMcGUBkDpfMtCKh+xz/4Q+wWRsZtd47SxWM6rrgrRlf2egtqNLQ6j9W0dNCD0u6Pv 1LVaMQBtrsmZXKrg0SwiDyIfGlt0lQ8AG0RCVNTp1QwWpqYjvrI0j7AIMcUxJgAK6lWX 1wBf7PacmrVlSmmjjSSXNK3OMf3tWPoTdVIJNHIXNZuDCXvCVPD9iZUHFtAk7nSz54C4 3q3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZXbbWzGH; 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 gr23si9359592ejb.87.2021.05.08.20.03.28; Sat, 08 May 2021 20:04:13 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZXbbWzGH; 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 S229685AbhEIDCo (ORCPT + 99 others); Sat, 8 May 2021 23:02:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229609AbhEIDCo (ORCPT ); Sat, 8 May 2021 23:02:44 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8D4BC061573 for ; Sat, 8 May 2021 20:01:40 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id a36so16506544ljq.8 for ; Sat, 08 May 2021 20:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c00F5gdQd8J96Q6xsAfPKXtIOJ12DymA7I1VC+ABJMI=; b=ZXbbWzGH/eL1fUAgVLnCJUUj6r+YqzdqdDMv0ikvcdMmVSBjVlBU3527+tNRCUaiSM 7m8ZTZPhoRTWkoXcymBN+P2y/Luf4xF3yzPt9VOXchyeMYTKTr57ivdXERQucDgeqYM2 ShoIySWR1fYr4SscaXtb78xNk5uidMng7rfzg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c00F5gdQd8J96Q6xsAfPKXtIOJ12DymA7I1VC+ABJMI=; b=q6jGsSaS9KPERgjxSeI2AGGBhGy2p4K7nUXbgX1KGGafvwtFIftlDDODArwygU6XyR iW0iS4LAoZ/k68AgxEbe/WlXGNdK5OtPIiFs6363V2EBEcytkdTsgi0oVFwYNH40GgpX fTujnxjPf3acay7MVrCi9Ztiw5WGkwiIQXmSCgnFKS8f3OBSCoHpcy+UepdvEmC4Ltb2 hjh+L/6r4dVViMQv3uPxomO0zN85L9POlgjbUha3M+KSGkp2q0J4gR/e4zwFERD8MTF6 yXP/QwQr+slPIHRiEbT5Kit+7/oTWCJ/w5qizbc7NmlhpG1Me5v3phhp5J6wAGSijK2j USUg== X-Gm-Message-State: AOAM5301BAUSYk8ZENQrPqTdX5mW9MyejUpGHHpL4PNiXPFK9szqf3cy r796Js7b/IhNuXl50YFyBg7CE2NOsbElvXazWt0= X-Received: by 2002:a05:651c:2009:: with SMTP id s9mr10340409ljo.31.1620529298709; Sat, 08 May 2021 20:01:38 -0700 (PDT) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id w23sm1773648lfu.132.2021.05.08.20.01.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 May 2021 20:01:38 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id s25so16558923lji.0 for ; Sat, 08 May 2021 20:01:38 -0700 (PDT) X-Received: by 2002:ac2:5e6e:: with SMTP id a14mr11470223lfr.201.1620528822658; Sat, 08 May 2021 19:53:42 -0700 (PDT) MIME-Version: 1.0 References: <20210508122530.1971-1-justin.he@arm.com> <20210508122530.1971-2-justin.he@arm.com> In-Reply-To: From: Linus Torvalds Date: Sat, 8 May 2021 19:53:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 1/3] fs: introduce helper d_path_fast() To: Al Viro 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 8, 2021 at 7:28 PM Al Viro wrote: > > 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. Well, part of this all is that the next step is that "vsnprintf()" with '%pD' would basically use prepend_entries() with just the RCU lock. That said, even with the rename lock, that will only cause a retry on rename - it won't necessarily fix any confusion that comes from the compiler possibly silently re-loading 'parent' multiple times, and getting different pointers due to a concurrent rename. Now, those different results should all be individually ok, due to RCU freeing, but it's _really_ confusing if 'parent' might be two different things within the same iteration of the loop. I don't see anything truly horrible that would happen - mainly "we'll prefetch one parent, and then due to reloading the pointer we might actually _use_ another parent entirely for the next iteration", but it really is best to avoid that kind of confusion. Linus