Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7383033rdb; Wed, 3 Jan 2024 14:14:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFE8vm3s6zNctnL61daSZTZLa3iZq4FLmsp7igGB/WgGoMYUDqxqjr0tO1TOpIN59n593QB X-Received: by 2002:a05:6a20:918e:b0:199:c4:72e3 with SMTP id v14-20020a056a20918e00b0019900c472e3mr692233pzd.28.1704320079855; Wed, 03 Jan 2024 14:14:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704320079; cv=none; d=google.com; s=arc-20160816; b=qXS0Xr6H0+b7kSgMTilh1p6ocwiNID6J/1oJ9wjk4tFdoGk0G//snufmhe08BSdqdk 7K+qbAr0fxtnC3gNLaILHaXxnsbLBhmgOHye001Yni7I/MsqvPgwVF4eGnaN1nB7Agci 5BIr/SXvj0zhXlggc9CRB++kRfIL+fU2a2TkfvI69pS23CkQJwMF86ko9M2gM+STwieO pNNcdVWkt3QVJAMqu+nESXDrBUg+RtnSjsaTZIqVyOOwF668Y3UfVKIj0ZEgHYSMgxRb Xog/Tr9BQz+USByUreHwomKQAy75ZZP3xW59NRQYsKJTdvtjCPDj6BUxBI6EUmy0ywXN jkTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=9MZB2GKQQoVizz0Mae9gZ/uAOfWAVjDPrCIYZs+35rM=; fh=fgaICQz76zZHp0eASD85TCOuTpy/GDMDzq73MouiQMo=; b=cPTdRbupoxOZiq4js6bos+YhEl12/aOEtdWp3SG1TPeV4YhgLt4DpV06TnRxhvjONc 1J+ykReFTduOcZryWYu+L7xQllNywe3Lfl0mr27Qe6/zyyR/kcAeLPGfxegevx2Zuxyx O/L7c5MRsPnGJ103snSjSrmDhMOiYvcA3xqO9C+/LI0NAXmyiIhvT4Bi/IRaTX0tIN4F zyNIm3vCR+fl/lbfMMYcuP8RV+bM97J1w9v1Puaur5HGD/kR+7MAcbQXvyXpcrqpC9GZ VQD4iNmU1yVuO/rwirRgMZj2PChRRjzRk3AtvtRqElB9xYJ4RzWo/YFZyXGL7gU0+N5B hy6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=aSp1CCxH; spf=pass (google.com: domain of linux-kernel+bounces-16059-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16059-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s62-20020a635e41000000b005ce018f4293si19226971pgb.701.2024.01.03.14.14.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 14:14:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16059-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=aSp1CCxH; spf=pass (google.com: domain of linux-kernel+bounces-16059-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16059-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5889E285EDF for ; Wed, 3 Jan 2024 22:14:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B9C01DA4A; Wed, 3 Jan 2024 22:14:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="aSp1CCxH" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC5F71EB22 for ; Wed, 3 Jan 2024 22:14:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3374c693f92so912634f8f.1 for ; Wed, 03 Jan 2024 14:14:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1704320066; x=1704924866; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9MZB2GKQQoVizz0Mae9gZ/uAOfWAVjDPrCIYZs+35rM=; b=aSp1CCxH+rQnW9MDXY+6XsfO399ujdTJOF6McZfSZe6t6YPUkAoShgzPMHfO9Z8Gg1 3Yi3ia0snMiCfvFguzmWMBBlg8vJE4962ohGzlOHOk2txIODJceljR6fD+UXO4F/C8vd iJAROsmGdWk9lPi6mkJrwt5cYiNs4EIxrSxnc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704320066; x=1704924866; 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=9MZB2GKQQoVizz0Mae9gZ/uAOfWAVjDPrCIYZs+35rM=; b=kdPJif8cda/OPUH0o5RVLvkMOJ03fuWGyE07o2R+iXDVNKweOytxjHg7QbnafJNejA RC26W0xXZYzJlcMz8TkR2l8EXWa0rKuwVcPpMYflwFJ2b4eGsKgnprNAOmsng0bqnWqF jMQu0Gkwoz+7HyEg+E7b2jRhz/WpdYWWvOyB3Nddii7OzigF7SJs4TUJETtDNLP0NfN/ cWb5kySdv18PzMbw2pqE8hrDQgIzetIHqKhIkpeoS5URuZ5v1SWe0QOCgRELwXpV2Z4k kov5ix/g1td3wcKu+PurWltvPwzApZ7X06Vk5oBRE4Ozl48eK46XpFBdVDpbtyjxTulO qMjg== X-Gm-Message-State: AOJu0YxkIvNtuwJEOAYSif6gkCqn1vSpdxbR1AerNU6ijxNd935R2b+6 tOwCltNQLJ3Pnv7j72MxvdSmCW0E+AAUY2BYfjgodZpBZH37FGP6 X-Received: by 2002:adf:d1e4:0:b0:337:509c:f1c0 with SMTP id g4-20020adfd1e4000000b00337509cf1c0mr316750wrd.46.1704320066541; Wed, 03 Jan 2024 14:14:26 -0800 (PST) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com. [209.85.218.48]) by smtp.gmail.com with ESMTPSA id ek20-20020a056402371400b00555f49e7080sm6543135edb.56.2024.01.03.14.14.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jan 2024 14:14:26 -0800 (PST) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a28ac851523so93613666b.0 for ; Wed, 03 Jan 2024 14:14:26 -0800 (PST) X-Received: by 2002:a17:906:6854:b0:a27:9029:4657 with SMTP id a20-20020a170906685400b00a2790294657mr3946525ejs.125.1704320065698; Wed, 03 Jan 2024 14:14:25 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240103102553.17a19cea@gandalf.local.home> <20240103145306.51f8a4cd@gandalf.local.home> <20240103170556.28df7163@gandalf.local.home> In-Reply-To: <20240103170556.28df7163@gandalf.local.home> From: Linus Torvalds Date: Wed, 3 Jan 2024 14:14:08 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents() To: Steven Rostedt Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mathieu Desnoyers , Al Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" On Wed, 3 Jan 2024 at 14:04, Steven Rostedt wrote: > > I actually have something almost working too. Here's the WIP. It only works > for tracefs, and now eventfs needs to be updated as the "events" directory > no longer has the right ownership. So I need a way to link the eventfs > entries to use the tracefs default conditionally. Ack. So the ->getattr() and ->permission() thing is a bit more targeted to "look at modes", and is probably better just for that reason. Doing it in d_revalidate() is a bit hacky, and impacts path lookup a bit even when not necessary. But it's still a lot less evil than walking the dentry tree manually. So that d_revalidate() patch was more of a "I think you can make it smaller by just hooking in at this layer"). So d_revalidate ends up with a smaller patch, I think, but it has the problem that now you *have* to be able to deal with things in RCU context. In contrast, doing it in ->getattr() and ->permission() ends up meaning you can use sleeping locks etc if you need to serialize, for example. So it's a bit more specific to the whole issue of "deal with modes and owndership", but it is *also* a bit more flexible in how you can then do it. Anyway, your patch looks fine from a quick scan. Linus