From nobody Tue Dec 23 14:30:03 2025 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 F101EC2CF; Fri, 2 Feb 2024 02:30:04 +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=1706841005; cv=none; b=U2F9tgwiKbKMWmYdZMZcQgv+m2XIa2zqlPsJnXKN2bv3Ecm+Ori+/iKqkekKjMbVAQvmMSvt29zfrzCTfkkAIe4pGmn4z49fmEWFjeFgcN1sV4/WLbNWomllOvt5U8BLFsKN4I7YpNse53KhVMfaMAsGiSiD5As1nDL0TEJ8Q6g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706841005; c=relaxed/simple; bh=Xuuj38zWAdqjpeYCtGvAUUvs1e01F3I0KslCF+lAPSw=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=hJrR1AFM9b5Lq++pIEp4Z6kcq8dVZkyFzt+9DW86TZXZGcpS5AmVjlV2pmqzVewVJq5xtFI5tWiAnQzM/n/qD8+grpTiB5AxsQnsjRxf4qbUd4gw68DtTvP8/RB3RivggUz02UTmoBqGbHH9RVvznTmgbvVMyUo9zKISAb2DNf8= 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 6E000C43399; Fri, 2 Feb 2024 02:30:04 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rVjJu-00000005k78-2En2; Thu, 01 Feb 2024 21:30:22 -0500 Message-ID: <20240202023022.390733076@goodmis.org> User-Agent: quilt/0.67 Date: Thu, 01 Feb 2024 21:30:02 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , stable@vger.kernel.org, Christian Brauner , Al Viro , Ajay Kaher , Greg Kroah-Hartman , kernel test robot , Linus Torvalds Subject: [for-linus][PATCH 03/13] eventfs: Initialize the tracefs inode properly References: <20240202022959.515961549@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Linus Torvalds The tracefs-specific fields in the inode were not initialized before the inode was exposed to others through the dentry with 'd_instantiate()'. Move the field initializations up to before the d_instantiate. Link: https://lore.kernel.org/linux-trace-kernel/20240131185512.478449628@g= oodmis.org Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Christian Brauner Cc: Al Viro Cc: Ajay Kaher Cc: Greg Kroah-Hartman Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_in= ode") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202401291043.e62e89dc-oliver.sang@in= tel.com Signed-off-by: Linus Torvalds Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/event_inode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 1c3dd0ad4660..824b1811e342 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -370,6 +370,8 @@ static struct dentry *create_dir(struct eventfs_inode *= ei, struct dentry *parent =20 ti =3D get_tracefs(inode); ti->flags |=3D TRACEFS_EVENT_INODE; + /* Only directories have ti->private set to an ei, not files */ + ti->private =3D ei; =20 inc_nlink(inode); d_instantiate(dentry, inode); @@ -515,7 +517,6 @@ create_file_dentry(struct eventfs_inode *ei, int idx, static void eventfs_post_create_dir(struct eventfs_inode *ei) { struct eventfs_inode *ei_child; - struct tracefs_inode *ti; =20 lockdep_assert_held(&eventfs_mutex); =20 @@ -525,9 +526,6 @@ static void eventfs_post_create_dir(struct eventfs_inod= e *ei) srcu_read_lock_held(&eventfs_srcu)) { ei_child->d_parent =3D ei->dentry; } - - ti =3D get_tracefs(ei->dentry->d_inode); - ti->private =3D ei; } =20 /** --=20 2.43.0