From mboxrd@z Thu Jan 1 00:00:00 1970 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 8CF71134CF7; Tue, 6 Feb 2024 12:09:18 +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=1707221358; cv=none; b=P5z+6gnCHm327WLYdmw20869BGkQl/PnftlJbb5Lg5oSrhdiLUA8K4vZoxHBcpkYZ+FcGb3bdcAz/KolXs3rh5mD6R3iNZDTb/XwKpRwnXRQpiX9Ybtk+OjfoUKO74FPH0hHR/dbf2hqlCO7w3rMR2NQZmJ+T4bl2Wp7VDr0hE8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707221358; c=relaxed/simple; bh=336aSR/98foY6hsKIaBZqloDqDtb5wcfOnRkQgXQYHI=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ikkcMQtQFknMBObDnDF2PibeUdct/mK71yEj/cWi6BOScWDcLJAvM39NrZxKxj57ZrkoGdsIrsGB+iIt4v/a/LF9lqxUt9jQu4n/hR+UAhLetd0xOzB4shW0hWaWEpdjzZLSeY+G2Lq8/8X1syQ8cMIz1mdMXhTHf0j936HkMtc= 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 38060C433F1; Tue, 6 Feb 2024 12:09:18 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rXKGo-00000006b1v-2qVQ; Tue, 06 Feb 2024 07:09:46 -0500 Message-ID: <20240206120946.536298441@rostedt.homelinux.com> User-Agent: quilt/0.67 Date: Tue, 06 Feb 2024 07:09:06 -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 Subject: [v6.6][PATCH 01/57] Revert "eventfs: Do not allow NULL parent to eventfs_start_creating()" 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 Content-Type: text/plain; charset=UTF-8 From: "Steven Rostedt (Google)" This reverts commit 6abb8c223ce12078a0f2c129656a13338dfe960b. The eventfs was not designed properly and may have some hidden bugs in it. Linus rewrote it properly and I trust his version more than this one. Revert the backported patches for 6.6 and re-apply all the changes to make it equivalent to Linus's version. Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/inode.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index 0292c6a2bed9..891653ba9cf3 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -509,15 +509,20 @@ struct dentry *eventfs_start_creating(const char *name, struct dentry *parent) struct dentry *dentry; int error; - /* Must always have a parent. */ - if (WARN_ON_ONCE(!parent)) - return ERR_PTR(-EINVAL); - error = simple_pin_fs(&trace_fs_type, &tracefs_mount, &tracefs_mount_count); if (error) return ERR_PTR(error); + /* + * If the parent is not specified, we create it in the root. + * We need the root dentry to do this, which is in the super + * block. A pointer to that is in the struct vfsmount that we + * have around. + */ + if (!parent) + parent = tracefs_mount->mnt_root; + if (unlikely(IS_DEADDIR(parent->d_inode))) dentry = ERR_PTR(-ENOENT); else -- 2.43.0