Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1070800rdd; Wed, 10 Jan 2024 07:52:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYni34rbZPIArUTBHd60FS2osFqNHxNvI3maYsC/Oe/zbFy0B9Eow249TdBa25Km2A+rv9 X-Received: by 2002:ac8:5a10:0:b0:429:7c62:99dd with SMTP id n16-20020ac85a10000000b004297c6299ddmr1683596qta.0.1704901923133; Wed, 10 Jan 2024 07:52:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704901923; cv=none; d=google.com; s=arc-20160816; b=t2a0kOMCMjj+kcOV6Zssi5NOZgaDWeNSf0a1qpQnlvtFHUDvMvPj5Ts8wO27S2eIuA 1BONg71lzjnYEEx6aqCm+Nn/xOBPkMqzuHJCup538UCcP78jrD6+g6z5iQ3gV9LmdOmx abwTlY7vd11FjIdkFL0gZ3KsfnRIgcPUEoEtHfypqFKMlaJmiznjh+OuzBYYD3N1lN4S pY1EZabSDJXlK0qxLwRTdJn3iwi8kcd7qfSvvKhJF3A1crZD/N4wC7j5lhJ2pZVM/n/W 4ycNm85aJaXz0VtGw/yCMe+DL9uOhifcygxtSF9WrxgwnwnN8ZIYtcBRFNnPDZnkeRCw LDcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=SiBqzjYYbk1Q/nlM9H/wjuLmZnIsFgzzpkgLSQ5rtHE=; fh=d0Ct0J+JiGzn8473V3+2DIY7dSmzIWejAPUIcKsWBu0=; b=qphCsMTuKcKYIClkke5tTk6S3t7/Rmi5jfVAmMF2LBYOMIFNskPV9/C3t+MbckJc3s QXm7VpAfyYplUwHoe70Q5NSs6u6AQzRyjEPGZDIZ6Nb9E+q5gGObHAfaCnW1MLlPMmfr JzCgJHhlelasm6exy3eTcxuPH9b0L6cv2pPuR4obxP7RXw94x2ulnr5o44lHlPzj9eoy +YRPaht1qN2kSzGXD1rbXoK5LYNhCVulxnx7V6FCTwmSndk0gldjJn/E5bh8DaQV33u7 xR4UqD/6SpWm8TyXnWlxWtwod7e51OYTEw9XS+1SfXmR/IvS38E8I3jL2J9nCibInmW8 l2iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22454-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o15-20020a05620a2a0f00b00783360f0d4asi1459234qkp.605.2024.01.10.07.52.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 07:52:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22454-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id DA4E31C229A8 for ; Wed, 10 Jan 2024 15:52:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0B164C3D7; Wed, 10 Jan 2024 15:51:52 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B5C24CB20; Wed, 10 Jan 2024 15:51:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BDF0C433C7; Wed, 10 Jan 2024 15:51:50 +0000 (UTC) Date: Wed, 10 Jan 2024 10:52:51 -0500 From: Steven Rostedt To: Christian Brauner Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mathieu Desnoyers , Linus Torvalds , Al Viro , linux-fsdevel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH] tracefs/eventfs: Use root and instance inodes as default ownership Message-ID: <20240110105251.48334598@gandalf.local.home> In-Reply-To: <20240110080746.50f7767d@gandalf.local.home> References: <20240103203246.115732ec@gandalf.local.home> <20240105-wegstecken-sachkenntnis-6289842d6d01@brauner> <20240105095954.67de63c2@gandalf.local.home> <20240107-getrickst-angeeignet-049cea8cad13@brauner> <20240107132912.71b109d8@rorschach.local.home> <20240108-ortsrand-ziehen-4e9a9a58e708@brauner> <20240108102331.7de98cab@gandalf.local.home> <20240110-murren-extra-cd1241aae470@brauner> <20240110080746.50f7767d@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 10 Jan 2024 08:07:46 -0500 Steven Rostedt wrote: > Or are you saying that I don't need the ".permission" callback, because > eventfs does it when it creates the inodes? But for eventfs to know what > the permissions changes are, it uses .getattr and .setattr. OK, if your main argument is that we do not need .permission, I agree with you. But that's a trivial change and doesn't affect the complexity that eventfs is doing. In fact, removing the "permission" check is simply this patch: -- diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index fdff53d5a1f8..f2af07a857e2 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -192,18 +192,10 @@ static int eventfs_get_attr(struct mnt_idmap *idmap, return 0; } -static int eventfs_permission(struct mnt_idmap *idmap, - struct inode *inode, int mask) -{ - set_top_events_ownership(inode); - return generic_permission(idmap, inode, mask); -} - static const struct inode_operations eventfs_root_dir_inode_operations = { .lookup = eventfs_root_lookup, .setattr = eventfs_set_attr, .getattr = eventfs_get_attr, - .permission = eventfs_permission, }; static const struct inode_operations eventfs_file_inode_operations = { -- I only did that because Linus mentioned it, and I thought it was needed. I'll apply this patch too, as it appears to work with this code. Thanks! -- Steve