From patchwork Tue Feb 6 12:09:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 197429 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1502704dyb; Tue, 6 Feb 2024 04:30:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+zLdQWzH4Kh8oQWGwNlblftBSFaI0byHZlwf16SOtDzFcSshty7Uo8IIqt53ep77l0f6A X-Received: by 2002:a62:e30d:0:b0:6df:bb25:ee25 with SMTP id g13-20020a62e30d000000b006dfbb25ee25mr2300589pfh.18.1707222605276; Tue, 06 Feb 2024 04:30:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707222605; cv=pass; d=google.com; s=arc-20160816; b=N1a4BppGTzlvH8La9i+2wNhjpE8ZRN6GIWLbfhodY6IR8OxThoatjF4ykUDSh+Pz4U 4/sYl1YGC9Fs+OOtjYgQYISBsLaG8Megvts/EeWNQVjPDy0cJjxHBnOD5kWmguEvTol4 bCyl7G5YToUQznTr0LxtS0/G0O/eu2viPJEJjHn11ZTHI7Cg0aFQT2eU/0Wno/wrfhWN tlElLzdWEfh2eoxp+QRfM2KVsHODCBe5XFy1GinrEw+oCRxIePY9dfGnSUGM8lvbxlu/ 9hmAttH4/iZ6a4A0Vwtrd6sGo4HsVpMQHG0/drWAtGZxBM0Jfmn+rPrkKZXTND3vk5LD Ai1w== ARC-Message-Signature: i=2; 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=kPf+5s8vNcVaTsPSULAocZwpEXtyatzZQyXY3z1B5Ec=; fh=+PmWt43nisI+iGh9662vXds8uHhZ/0ZiAHrJlxp2s7E=; b=OP8l9LGGI7bcFwpi7lzgqnddbQ8qmqjq/CnWzlOzVHCKUuExIahBqZRgVnAhzTvdhP QPvkkJX1hDdPQ6oxYmEHgd+i5xxtGh8MsX9ICEtEWwoGqKD43P/VrcoU9St7MfMZSCqo t8s6DDSdgseIwm+7z7Vp4kL1W3c4H+DxRlsLw8L789nIbLQljLj1elTVf8RSJkP30Lmi CfwKBDmeK6jN1eZMhKpxbwE2EuqobKXl6uO7gm2EtTB/7O/AKSYGm/3rtgXGWhsK7jAy wsfqKwQEou3pJxCpkWW+7dUSW+NbCBdmpD00Q6xbKzhDcP3XGSY4mZWxbWwGNJN/M0kI T/TA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-54897-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54897-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUARD0Qsp11paspUf6UAeRhqwbrhnneUGRGvEQLMaIBdtun6Z6S2eL0xt7ID+jD5NceQSggbuQp0t9bGC0V5ghi0SVgpg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d22-20020aa78696000000b006e03d6e64d3si1562197pfo.175.2024.02.06.04.30.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 04:30:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54897-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-54897-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54897-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D1FA0B26226 for ; Tue, 6 Feb 2024 12:21:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F30914079E; Tue, 6 Feb 2024 12:09:30 +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 B775113699D; Tue, 6 Feb 2024 12:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707221361; cv=none; b=cpumw0e/kW0h0nlu2LTaOsTKtyVts7m6Br3XVr3LnOMtP4Rgj6yBnrzFVpx6ON+wiSML1y9Tzkg7DETYs2JbkbfJcQLAEQLSn2B/vNYrCerO/Rw7qr9CftwlbLMB9yopyXi771znWm2K6PIrLSwLT9LSZTMZ/94IsHYzaefy7DM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707221361; c=relaxed/simple; bh=2uaDNgIJzLo4+YSpk1Akkna6ka+cyIDf3T52EWN75N8=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=RkYYorVaGDm9ysSwNgJlv4m39UXoqrVDHAjcZRoqbJYFNOYg9wWBkp5f3SnIJcFKDI2eDtlUsAG3qAG92cRbwOPrENkzizZ4sVOIahqvoE2vDa3+HQv2Ix8dTnTVcDg4zA6omTnVrjJUL/RQLJiyMSCdljccM+r8R4iTFfI4kKU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1F80C43601; Tue, 6 Feb 2024 12:09:21 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rXKGs-00000006bCL-0Pyc; Tue, 06 Feb 2024 07:09:50 -0500 Message-ID: <20240206120949.956372816@rostedt.homelinux.com> User-Agent: quilt/0.67 Date: Tue, 06 Feb 2024 07:09:27 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Linus Torvalds , Greg Kroah-Hartman , Sasha Levin , Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Ajay Kaher , Andrew Morton Subject: [v6.6][PATCH 22/57] eventfs: Remove special processing of dput() of events directory References: <20240206120905.570408983@rostedt.homelinux.com> 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: 1790152650175119691 X-GMAIL-MSGID: 1790152650175119691 From: "Steven Rostedt (Google)" The top level events directory is no longer special with regards to how it should be delete. Remove the extra processing for it in eventfs_set_ei_status_free(). Link: https://lkml.kernel.org/r/20231101172650.340876747@goodmis.org Cc: Ajay Kaher Cc: Mark Rutland Cc: Andrew Morton Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) (cherry picked from commit 62d65cac119d08d39f751b4e3e2063ed996edc05) --- fs/tracefs/event_inode.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 0a04ae0ca8c8..0087a3f455f1 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -274,28 +274,11 @@ static void free_ei(struct eventfs_inode *ei) */ void eventfs_set_ei_status_free(struct tracefs_inode *ti, struct dentry *dentry) { - struct tracefs_inode *ti_parent; struct eventfs_inode *ei; int i; - /* The top level events directory may be freed by this */ - if (unlikely(ti->flags & TRACEFS_EVENT_TOP_INODE)) { - mutex_lock(&eventfs_mutex); - ei = ti->private; - /* Nothing should access this, but just in case! */ - ti->private = NULL; - mutex_unlock(&eventfs_mutex); - - free_ei(ei); - return; - } - mutex_lock(&eventfs_mutex); - ti_parent = get_tracefs(dentry->d_parent->d_inode); - if (!ti_parent || !(ti_parent->flags & TRACEFS_EVENT_INODE)) - goto out; - ei = dentry->d_fsdata; if (!ei) goto out; @@ -920,6 +903,8 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry inode->i_op = &eventfs_root_dir_inode_operations; inode->i_fop = &eventfs_file_operations; + dentry->d_fsdata = ei; + /* directory inodes start off with i_nlink == 2 (for "." entry) */ inc_nlink(inode); d_instantiate(dentry, inode);