From patchwork Sat Dec 16 04:22:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 179807 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp30107dyi; Fri, 15 Dec 2023 20:23:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwzapbOT+Rb88TUI3N2uIlWQbkiYaL3HgVtkxN06PIlNGadgwX3vxAKJbDWnmYPd6jvfQP X-Received: by 2002:a05:651c:11d0:b0:2cc:2f77:a5fb with SMTP id z16-20020a05651c11d000b002cc2f77a5fbmr3063945ljo.31.1702700591318; Fri, 15 Dec 2023 20:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702700591; cv=none; d=google.com; s=arc-20160816; b=QuS/h7EYjveo4KusRY/8UBpsLbN9ACCUAfZOs9xJwrbb8YztHeMTR02+5WEkiYwqIg IY1jAnsEu15nmYd0KNw6icknrYWrFpTC01uLymrklVd9nr0Pt1AM8AAvvX/e2COMhDik 9FT6xnQl77QzdlVEh1kdqDg6Q2uH3Wo1z1gxr7SizQnT9cZDjcXdJt+1M5SgI9WHCewA ZB1CiIaEGbvAPBwyQPoEA0mVPZKWJTaoy/1PRO9vxf7ollU0DZ2ZnPqSmv/3h/fUITvC CiZuebeSiIpPJShw4Btr6X3fOb3gPEQyTqv2AKqGjWZVWJxBLC4MjKofpTkvwNr2SsMV JXBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=c0KZf5RT80r58fVl6ue2FjRINMhaweT4HjI0Qw8IK6M=; fh=sbDUv6PuKPAkpuv6zbp1fPCjJZUEufc8KwKtgDDsdwc=; b=Cbgqvr7Czn5D3tp7byTrM8KUSLlEuPUXNn5ZLyiExxoVR/R9peultZ11WVraYosNyg NQLb6Lpe0Oh9hPhPClT4JBoERhM30qj2EMNlnFuD3+tGYd0Uwu8bpMGRxDAbf1HAjJNK 3/QyRbuxJW2dC1S/0Qhi5SBKJNOx/+1ONS+X99EfXoWENFfOfhHnc3M4tiR9UXWOblCG a0XuMRy5vy0KH70dCJQhiW+QWNQsAU6YkNImqoKX3RWUul/BJNUOHQ0VSQjISr9eAMHi Da2Gcy9h3Vc9kZr7BMRsl+cNw2GlNBO21ldYIJa7n7QUnpWR205wXsdNJ2ClBrhBdXyg ZvAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-2046-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2046-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b8-20020a056402350800b0054cae753509si7948902edd.412.2023.12.15.20.23.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 20:23:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2046-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-2046-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2046-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 am.mirrors.kernel.org (Postfix) with ESMTPS id DB8871F25A4E for ; Sat, 16 Dec 2023 04:23:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A06DA18042; Sat, 16 Dec 2023 04:21:53 +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 18CB51119E for ; Sat, 16 Dec 2023 04:21:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4E80C433C7; Sat, 16 Dec 2023 04:21:51 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rEMCI-00000002yBl-336s; Fri, 15 Dec 2023 23:22:42 -0500 Message-ID: <20231216042242.519691764@goodmis.org> User-Agent: quilt/0.67 Date: Fri, 15 Dec 2023 23:22:17 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Beau Belgrave Subject: [for-linus][PATCH 03/15] eventfs: Fix events beyond NAME_MAX blocking tasks References: <20231216042214.905262999@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785410975498526704 X-GMAIL-MSGID: 1785410975498526704 From: Beau Belgrave Eventfs uses simple_lookup(), however, it will fail if the name of the entry is beyond NAME_MAX length. When this error is encountered, eventfs still tries to create dentries instead of skipping the dentry creation. When the dentry is attempted to be created in this state d_wait_lookup() will loop forever, waiting for the lookup to be removed. Fix eventfs to return the error in simple_lookup() back to the caller instead of continuing to try to create the dentry. Link: https://lore.kernel.org/linux-trace-kernel/20231210213534.497-1-beaub@linux.microsoft.com Fixes: 63940449555e ("eventfs: Implement eventfs lookup, read, open functions") Link: https://lore.kernel.org/linux-trace-kernel/20231208183601.GA46-beaub@linux.microsoft.com/ Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/event_inode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 0b90869fd805..43e237864a42 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -546,6 +546,8 @@ static struct dentry *eventfs_root_lookup(struct inode *dir, if (strcmp(ei_child->name, name) != 0) continue; ret = simple_lookup(dir, dentry, flags); + if (IS_ERR(ret)) + goto out; create_dir_dentry(ei, ei_child, ei_dentry, true); created = true; break; @@ -568,6 +570,8 @@ static struct dentry *eventfs_root_lookup(struct inode *dir, if (r <= 0) continue; ret = simple_lookup(dir, dentry, flags); + if (IS_ERR(ret)) + goto out; create_file_dentry(ei, i, ei_dentry, name, mode, cdata, fops, true); break;