Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp847646qtx; Mon, 31 Oct 2022 15:39:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM58jVqbdEjtLOqxW6YZGuja8iQN6TyhrstaltGXhPmw7S6s7QErIqZ7alBePdJZF9bGAQal X-Received: by 2002:a05:6402:d0b:b0:458:a244:4e99 with SMTP id eb11-20020a0564020d0b00b00458a2444e99mr16249255edb.46.1667255984727; Mon, 31 Oct 2022 15:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667255984; cv=none; d=google.com; s=arc-20160816; b=teqihEHzOq/MLkQdXYfZTuQ+UypYAeZVk5bAU4NcRpTUugs5XipVcELLG6yI3o0JRt PsySqMfMD49adzTFBDsfGjgdP+ddZaC94C+hXnzz0FzByZKHNWUl1mzl8+KIKztUEViG E51CrnSA3wNp76x2PzouS3MZsLQgiBi4BzPIXL8+4QBGYCulHFKwU4LLRk4nekLT1nuo 2e/yRo62urWZjO7mTNZT0aKMqYfFWsQKYOlhgxZ2g90IJIQtzdIeKApmJdiCBKFVnbCL 9QlnkxuvG7fiuxcP1wt/xwgMXpK1LoOM+WmUAOdfZwJAWGIyJ+T3+xoq9ODR3bEuOhYK JBrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=PRvSxv/dMXK9FkZdU40r1Y99Us3P1pzd7oqWG3jSj48=; b=O25oxSEtJFe4ELRTlCRf/zQ8Mf+QXjQ2aueqQmPkYe+dDWXHALrmaXbJhH3l+AjWyt 9uskVa5E9/eJKWvF8ig2FZmRkclwQtBjzQuGUXJYPTD8fzGaATz6RMqlCmEkHxsX0ebs KgjhzEI7ZCstB6IDlE2kYZKoFqcBfEWTDx2dRVCRlnwbV+x0GxIVugrQ827yc8UwkOE8 h1QLRb91zko0iEZ7F3vogjR1s51SN5DQwhu2A8HvzjN5CauL+GylQLA4IefgGcC+uR0r etIk/AeHMu22D6fd3LkC9HiOhM6EGYOxnHQulzONuFjCqe3jNvVZbmaonUKeRLXqK7IC JSYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VUE9w0Wv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd22-20020a1709069b9600b0078034101c0esi10105451ejc.978.2022.10.31.15.39.19; Mon, 31 Oct 2022 15:39:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VUE9w0Wv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbiJaWbD (ORCPT + 98 others); Mon, 31 Oct 2022 18:31:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiJaWbC (ORCPT ); Mon, 31 Oct 2022 18:31:02 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5490213EB3; Mon, 31 Oct 2022 15:31:01 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id io19so11977770plb.8; Mon, 31 Oct 2022 15:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=PRvSxv/dMXK9FkZdU40r1Y99Us3P1pzd7oqWG3jSj48=; b=VUE9w0WvnMs8KMSmXmMyerO/xwsIP2cTNHqOj+IkFjDI9we0eVx4T8GpUYOBgwzc3d u3f2QVAZSqg1DfrYDBCFzkSf/Iv4yA+CwHF2EHJQKHBZ3mkyky19zOuMRGKuBDZuqAlD U+FfDtBEJYz2qtRwA2r8Vb1F1LEXbbXNbEnZiBkjh5wdccrWiV5VT2JpOvDVSIKTtkpV FTUIZBz9VQe5rKAzqYoj5vdtVrxodkvbBXAdiE/LCl+tD2NDdmFSj0jfCLbWJWeyTpg9 kFsBpRyW71bPYxQHRZZ3GV7cVSdQpfuCsgOoEQQEILn/2/JwmeNDinDM6opsZjXTzwSm 5ODQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PRvSxv/dMXK9FkZdU40r1Y99Us3P1pzd7oqWG3jSj48=; b=b8CJuiu5C3y+dbmxE8TTxg8LB9pfsto/2281cCBy0IejuBcHBpjtOYXioUBr5tBFXo UoXxZUAOk4mbPIQ/qjoima4kT8R2vl9ZYcgO9UX3nr7ClJWduJtc1bCE/YaS0+fkZ+3u NawvOpKxk6rPvrr6LIlCqacszwAahXaHtxghbYN4u21pnWoieR47w47My9zkz5BTmIaM PhrirzS73MlXDNWNGBYTHRPD8au9Gjp7ibFjMxfwt1GZ3sdrDQBSS7Nn8NmO6xi7SWoK 2lAN6nBSuYgqkmewHtFGcgUcPjkbd9U0GYrhZ2NABeMPHv2ruB20U5YMQfNFejUVinZ1 veHg== X-Gm-Message-State: ACrzQf29W/WLyHnCxVzUEh6NSrwB5dVorAhJWTGfLH2qU1TFwsXURr6U GqN/cRNrgFjj71eT/QhY17C5/ZlGoy8= X-Received: by 2002:a17:90b:33d0:b0:213:137b:1343 with SMTP id lk16-20020a17090b33d000b00213137b1343mr17175534pjb.128.1667255460698; Mon, 31 Oct 2022 15:31:00 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::5:ba13]) by smtp.gmail.com with ESMTPSA id r13-20020a63204d000000b004308422060csm4568309pgm.69.2022.10.31.15.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 15:31:00 -0700 (PDT) Sender: Tejun Heo Date: Mon, 31 Oct 2022 12:30:58 -1000 From: Tejun Heo To: Ian Kent Cc: Greg Kroah-Hartman , Minchan Kim , Eric Sandeen , Al Viro , Rick Lindsley , David Howells , Miklos Szeredi , Carlos Maiolino , linux-fsdevel , Kernel Mailing List Subject: Re: [PATCH 1/2] kernfs: dont take i_lock on inode attr read Message-ID: References: <166606025456.13363.3829702374064563472.stgit@donald.themaw.net> <166606036215.13363.1288735296954908554.stgit@donald.themaw.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <166606036215.13363.1288735296954908554.stgit@donald.themaw.net> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 18, 2022 at 10:32:42AM +0800, Ian Kent wrote: > The kernfs write lock is held when the kernfs node inode attributes > are updated. Therefore, when either kernfs_iop_getattr() or > kernfs_iop_permission() are called the kernfs node inode attributes > won't change. > > Consequently concurrent kernfs_refresh_inode() calls always copy the > same values from the kernfs node. > > So there's no need to take the inode i_lock to get consistent values > for generic_fillattr() and generic_permission(), the kernfs read lock > is sufficient. > > Signed-off-by: Ian Kent Acked-by: Tejun Heo Thanks. -- tejun