From patchwork Thu Jan 4 01:52:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13510728 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 598B74C65; Thu, 4 Jan 2024 01:53:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0647AC433C7; Thu, 4 Jan 2024 01:53:31 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rLCwN-00000000qgq-23WX; Wed, 03 Jan 2024 20:54:35 -0500 Message-ID: <20240104015247.075935881@goodmis.org> User-Agent: quilt/0.67 Date: Wed, 03 Jan 2024 20:52:47 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Linus Torvalds , Ajay Kaher , Al Viro , Christian Brauner , linux-fsdevel@vger.kernel.org Subject: [PATCH v2 0/2] eventfs: Don't use dcache_readdir() for getdents() Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: After having a "pleasant" conversation with Linus over on the security mailing list, we came to the conclusion that eventfs should not be using the dcache_readdir() routine for iterating the entries of a directory (getdents()). Instead, the .open and .release callbacks of the directory file operations was removed and all the work is now done in the .iterate_shared. The function dcache_readdir_wrapper() was renamed to eventfs_iterate(). As the files and directories of eventfs is all known within the meta data, it can easily supply getdents() with the information it needs without traversing the dentry. Changes since v1: https://lore.kernel.org/linux-trace-kernel/20240103102553.17a19cea@gandalf.local.home/ - Broke up into two patches, one to fix the lookup parameter and the other to do the meat of the change. - Moved the ctx->pos count up to skip creating of dentries in those cases. Steven Rostedt (Google) (2): eventfs: Remove "lookup" parameter from create_dir/file_dentry() eventfs: Stop using dcache_readdir() for getdents() ---- fs/tracefs/event_inode.c | 241 ++++++++++++++++------------------------------- 1 file changed, 80 insertions(+), 161 deletions(-)