Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6490856rwi; Mon, 24 Oct 2022 02:04:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5EgavGbp8MUAA6qIEaOJqTpbNSPcODlkj+crDVV/c4CbZlMBXnF9OAPCG3iEnTwx/NDtLS X-Received: by 2002:a17:907:7b95:b0:72f:9c64:4061 with SMTP id ne21-20020a1709077b9500b0072f9c644061mr26626745ejc.351.1666602255534; Mon, 24 Oct 2022 02:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666602255; cv=none; d=google.com; s=arc-20160816; b=Jm6raM2KdU+18AD+a9jB9AxLl8VGOrn69fmtezQy4RL5u2SWwpUf7F63iF8nHX2T3p 5Sqghu/WB250vi7TTOhhS8EpF3vXUOupLYnIBiIAvDGXNrtz/5RKHjQgwrxfkNG31vl2 KD1hB3pJ+8wXbrgAD9kmdl8rrElsYA+un79hOBS2OATjt3B8NzxEXaHgrc6wIj47kNnu oYw0qzDrOOSIfdZ2dvUOx+Z6zuvWB9zF6aCc1NisLNZSKhLyYoaJaQP8wi7aW8OKlNFf eSuS5xvwEVXrs7IzFNVMJhCqe7lcifPyb9qKUHv9ML7FgCp51ghKvwHbkUAXO8mTzJbJ 6okA== 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=48RogcYAddblRnrwwegwTV8L7KkpXpBRUanF9H4ZX04=; b=Wfc+SxB3BWNbtVMKpxLIsWRE6A/IfVLv+9H8BTtD4F+bqOIUOWYk0UpU/8rmS9Vzo3 btjiM88xvpVsym7BDAh6uaXym3pa9Gg+xlOHiW8/qtmp7S4zPbndcCxliXUwFsEy8RIe 0D6cq1wO3xhBJHEAkVFOya3Si5K+9WumOtZ81DloneKkhKRR3V9LT5es5YPdBZrK/Ch9 yERMGLn5R/RpC35ENYvFla/cCrIiM0XIHQWT663b4OuX60KLhHbXT2axj07aZWMH9hCl UPVPrRWLbay8PUOzwPshJREJ/2yGILUOVieUPno+J3F7u9fNVOPbVBzaAC7SlaWK5/JQ S9dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=Mt4BNTvi; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr9-20020a170907720900b0078cffd3ce3esi23979566ejc.654.2022.10.24.02.03.48; Mon, 24 Oct 2022 02:04:15 -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=@szeredi.hu header.s=google header.b=Mt4BNTvi; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229520AbiJXIvM (ORCPT + 99 others); Mon, 24 Oct 2022 04:51:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbiJXIvH (ORCPT ); Mon, 24 Oct 2022 04:51:07 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E47CE4F692 for ; Mon, 24 Oct 2022 01:51:03 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id v27so6276252eda.1 for ; Mon, 24 Oct 2022 01:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=48RogcYAddblRnrwwegwTV8L7KkpXpBRUanF9H4ZX04=; b=Mt4BNTviARWRqeEoVFmvLXAErFK2+IHQQ8hrJWYLW4IAjOmj8YOZjI2mcJYnFm9PG7 B30YYlX0Cip1NK7gxjfWE7B8qymm72JXogMpRH6sD5/QtmK5daJQo03sC5lDDl6hvahp ggpMlxtLLPqnbjAYF6cN3yclnYgt2zm2qdRiE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=48RogcYAddblRnrwwegwTV8L7KkpXpBRUanF9H4ZX04=; b=OoRRjDPIzpWFbFRcIgJNCBk8JM7XpzCADfmcEkVlfLUyjhXa5QZwD+fRS23Bm3hxpk CMRmG0h8EuyHBpI0RFPC8FHj928yK0jefrroiYZqwwMVEQnrRNq0pQq76Q3SNI3oSW6N 3fzOUM6thEZdOmoPwjvWGtp+v1DUVJ14IcTp1LOOUG0w4UnJnMSUrFyVXIO7FyLEXW10 NU/MH0XecAMRJ7DY47+XiI/nF6j2e6qHmvSpuLYZUGUiSsxTNTOH5v9lT1jisWA8bJAK HktzXVzvE0x8sAWWKOtLVE1Wsofpz8+dWVc4c1Mxnb4k9cDXM46UqEIfpylAOQGIK4G9 jbpg== X-Gm-Message-State: ACrzQf3RVuUtpgm0w3E4wqmrdImmG89T5Oz+ClW1Mf4HbfNIyQ7fn1+M 74BvSbIQ+zts4QOpQPpqk7kATUNvbKIOtMebUhfxJQ== X-Received: by 2002:a05:6402:370c:b0:453:9fab:1b53 with SMTP id ek12-20020a056402370c00b004539fab1b53mr30540317edb.28.1666601462322; Mon, 24 Oct 2022 01:51:02 -0700 (PDT) MIME-Version: 1.0 References: <166606025456.13363.3829702374064563472.stgit@donald.themaw.net> <166606036215.13363.1288735296954908554.stgit@donald.themaw.net> In-Reply-To: <166606036215.13363.1288735296954908554.stgit@donald.themaw.net> From: Miklos Szeredi Date: Mon, 24 Oct 2022 10:50:51 +0200 Message-ID: Subject: Re: [PATCH 1/2] kernfs: dont take i_lock on inode attr read To: Ian Kent Cc: Greg Kroah-Hartman , Tejun Heo , Minchan Kim , Eric Sandeen , Al Viro , Rick Lindsley , David Howells , Carlos Maiolino , linux-fsdevel , Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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, 18 Oct 2022 at 04:32, 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 Reviewed-by: Miklos Szeredi