From patchwork Thu Jan 4 21:57:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 18733 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5891916dyb; Thu, 4 Jan 2024 14:01:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOImu25eX4pvSdzK3L7QsZlWJ7LGCuEcbZgfsm8gu59/nUNc8eREYtE+cln74ruRcEzpVZ X-Received: by 2002:a05:6602:182:b0:7ba:c1d9:7664 with SMTP id m2-20020a056602018200b007bac1d97664mr1220089ioo.20.1704405676238; Thu, 04 Jan 2024 14:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704405676; cv=none; d=google.com; s=arc-20160816; b=vJuGah62mtdaks7ZoE2JYNTshccc5rZPtt1DshPY8NWmNA1TPhh14fEDgvIp6YcjI5 /ThyEz4WqUfoqFu6eAMMbwGXop7ROS897uIP4NwbbS5i1XxsnK+wDWzD8Yn3a015xXPo 6IjLOCOqivNu938nrjqTStyS93Qg6GvQOM5vvA/fdE/MwBz2jEQhxCPX7VYZzi9g5Kqw 14FGnM7Gg3vhDi/Mx0xC0XepQqDM7cUV1oJQsJ513FScuXeKemABHyjyAQ/5mtipVzFj er+nU+i8vOMc3wQNRN+ePfLyaS03577O+JbSi77Tx9uWkWS1nCqIDghzKyVZ9K8uLp0T yJdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :from:date:user-agent:message-id; bh=ImigcAi87oQdCwZYz91wkv+VfplQ/kw0lJ5ejyrji10=; fh=/+b36Kyncow8zkAf4U206kHBsn7X4TQclH3EtkME/8M=; b=taDVjVbs9BJVfwFAedqKDXSfi7DoHGv1ivq14u5yeTJGUXWDHVrr0R7UHU1XJPRSeD JBROyfchkCTWzJ01uko0tlT/x5+4ymHT0KSw+vcXnfr7nInQtDaVabEcnn5RF2Y7Gw8l K5T/AiVrOFlmpKWLRlkzIWPe53ZhZfHMG4uQMNPcyjfEzOyAUyHbdG761QW/ItWUhAid fL5nDyHISNcEc323QeIP20e3V1Lv1+jslVGAV5dBPy17qVUts6/kSocgyg4ZESKj0YPC q7kivkzDGcRgnlw5upfsqT0k1OlpjOyQHw1HgcY5skUBnFSA+gn/muhSKgtl5d6dX1EO XWyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-17267-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17267-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w186-20020a6362c3000000b005ce0474353csi234880pgb.238.2024.01.04.14.01.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 14:01:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17267-ouuuleilei=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; spf=pass (google.com: domain of linux-kernel+bounces-17267-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17267-ouuuleilei=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 10A4C288488 for ; Thu, 4 Jan 2024 22:00:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D281F2D7AA; Thu, 4 Jan 2024 21:59:43 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 399802C862; Thu, 4 Jan 2024 21:59:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6B90C43391; Thu, 4 Jan 2024 21:59:41 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rLVlf-00000000vfj-49as; Thu, 04 Jan 2024 17:00:47 -0500 Message-ID: <20240104215711.924088454@goodmis.org> User-Agent: quilt/0.67 Date: Thu, 04 Jan 2024 16:57:11 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Al Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 0/4] eventfs: More updates to eventfs_iterate() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787198886634117856 X-GMAIL-MSGID: 1787198886634117856 With the ongoing descussion of eventfs iterator, a few more changes are required and some changes are just enhancements. - Stop immediately in the loop if the ei is found to be in the process of being freed. - Make the ctx->pos update consistent with the skipped previous read index. This fixes a bug with duplicate files being showned by 'ls'. - Swap reading ei->entries with ei->children to make the next change easier to read - Add a "shortcut" in the ei->entries array to skip over already read entries. Steven Rostedt (Google) (4): eventfs: Have eventfs_iterate() stop immediately if ei->is_freed is set eventfs: Do ctx->pos update for all iterations in eventfs_iterate() eventfs: Read ei->entries before ei->children in eventfs_iterate() eventfs: Shortcut eventfs_iterate() by skipping entries already read ---- fs/tracefs/event_inode.c | 67 ++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 31 deletions(-)