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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 4C865C48BD1 for ; Fri, 11 Jun 2021 13:13:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B61D613EE for ; Fri, 11 Jun 2021 13:13:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231812AbhFKNPr (ORCPT ); Fri, 11 Jun 2021 09:15:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231479AbhFKNPq (ORCPT ); Fri, 11 Jun 2021 09:15:46 -0400 Received: from mail-ua1-x935.google.com (mail-ua1-x935.google.com [IPv6:2607:f8b0:4864:20::935]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95077C061574 for ; Fri, 11 Jun 2021 06:13:48 -0700 (PDT) Received: by mail-ua1-x935.google.com with SMTP id d18so2543509ual.7 for ; Fri, 11 Jun 2021 06:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EaDxm7CAMccH6BxkH3jMQSzq1sz+JsTOHJ81BcDQxlc=; b=Ex2De4dHAN5GsZSCNxo84B8s/T/KbAuuiZl/QmTRrOZ5HiOuqZh7rYh4QgJVvpYv8B fxNg5SPcXBuIk3m7aqDwhkoHklDHFoT7qrk2VlpMKDu05oeWd3ppy767v/LYMxqFwqjE aLOK5ZY2PyQCHetjeEqvNAnQU60n064ubIDjI= 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=EaDxm7CAMccH6BxkH3jMQSzq1sz+JsTOHJ81BcDQxlc=; b=p3a3HsV8BAKEzn+aYNRkHPliwQVchwn/kt8dLUVQDCVMw2VgcpUf2t35JMaIwjQkaz VQWqda36nfIlqiIFJu1dSNdb9c0od5dYEsj2ItxvS9LmNOwXAcFI6jqkZwbmlFbGniqi i8EPOJ21rx5n0LGJUewXdM2YaPg4VhrDwT4LlJEX5n2yH3587LM514HkDEKjQ2UZLww4 7H2yfqsXpkhLvxArlFfo1FYc/5MwSem5YFZ2xisIvEIvPHdWtjiwFP8JeUVPTPBwKDT4 IhXGZ2J6PkYwyY01EPNn6cCyrZTuJPblHS3rdXukzRmQ1F0pviIubWBlSB1TOlpACCIz tPdw== X-Gm-Message-State: AOAM530/CyrWWHy1cQFXgxUrZALkbenQumNePIUKwMLN2s/YBtAVI025 i+6e6z/lRVURPE5d+kmso7PFKrk4Jm3sv7QnO1YHCQ== X-Google-Smtp-Source: ABdhPJx44Ziz7vPRZ46bsBmuGBMqTKcmVOpww5OiQk+u1PD4sFDnONguBzgZ3BY8hkisnZD5KFTvHUQILKdDYVrB5YM= X-Received: by 2002:ab0:2690:: with SMTP id t16mr2923322uao.9.1623417227768; Fri, 11 Jun 2021 06:13:47 -0700 (PDT) MIME-Version: 1.0 References: <162322846765.361452.17051755721944717990.stgit@web.messagingengine.com> <162322872534.361452.17619177755627322271.stgit@web.messagingengine.com> In-Reply-To: <162322872534.361452.17619177755627322271.stgit@web.messagingengine.com> From: Miklos Szeredi Date: Fri, 11 Jun 2021 15:13:37 +0200 Message-ID: Subject: Re: [PATCH v6 6/7] kernfs: add kernfs_need_inode_refresh() To: Ian Kent Cc: Greg Kroah-Hartman , Tejun Heo , Eric Sandeen , Fox Chen , Brice Goglin , Al Viro , Rick Lindsley , David Howells , Marcelo Tosatti , "Eric W. Biederman" , Carlos Maiolino , linux-fsdevel , Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Jun 2021 at 10:52, Ian Kent wrote: > > Now the kernfs_rwsem read lock is held for kernfs_refresh_inode() and > the i_lock taken to protect inode updates there can be some contention > introduced when .permission() is called with concurrent path walks in > progress. > > Since .permission() is called frequently during path walks it's worth > checking if the update is actually needed before taking the lock and > performing the update. > > Signed-off-by: Ian Kent Reviewed-by: Miklos Szeredi