Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2489801pxj; Mon, 10 May 2021 04:21:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk0TM4a6RgtdhxR4tFDqNjQhy2vAWBgc7MvWnusbazKVHLrQzeJS8AJlL6copmf/m7M/1t X-Received: by 2002:a05:6e02:194b:: with SMTP id x11mr21995042ilu.213.1620645666754; Mon, 10 May 2021 04:21:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645666; cv=none; d=google.com; s=arc-20160816; b=MFatBIil/xNKpadz9HCQcKS60TWFEXm25yvdK5X9Fkquvq4u2Qw2BaxRi0Cc8vTnmk +OkFuRvtOcPXNnhtdhjRKrUcu1eVUjb9UkIXSclGWgCGnxgXVQpQY4ZxogUmnWMjDrm9 J+1g6NB/zcussuoY6gH0CaBeNCwk0qWJH6gOyi5kKBQNbAkUn8v7zlbjb+liuTH3t0mO 7bASKkPbZPr/iJNJVFoE1Z2W5O0Ohr4ijoT/E3KGQgcy+EkMWHW1x6JxergheQVXaJvf S7q0ZXe7tBo3ojC5pf/G0c1ZQfCFVa6DOU027nIw/sEus6bNb5B2aiHkM7P7rrvoPP4T 1Vww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YGpRULAY44w1LRYbxRZdm1DW6alRuyKiWyTjoUQkJOA=; b=vKh0198J+2qS5xqy/YLwHQH05AYPnMYWSHGdquJmF7C38tb1i6yx4yp27QlXnYZQVR 5Bl4XEnhGnMqGdJmzu1nhdkoEoSJOrq258Gpwu2Ce33BbgsfhRvO2PdUXRYZwqwZEWdr NZxIxED++LHpMAEyv6AuBaRimSPLjaQsT5espLWmYHH+Z54HsC/R/+QzHx3brlUFwPsA amW9/fEUiNTKExtnccXoVM7CLYsKhyld+exkNXjcdXwYDnYBjsq/nPYCU78qxHNPRtxz kZbqizr4sclvMnhwbdC5ZBKJQU33GCODDbHXWRNs+HLm5m8pDgpy3xbJEfcGLRygGMIh 9j4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NEgvgswo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si15025179jaq.6.2021.05.10.04.20.54; Mon, 10 May 2021 04:21:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NEgvgswo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237740AbhEJLQD (ORCPT + 99 others); Mon, 10 May 2021 07:16:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:41914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231609AbhEJKum (ORCPT ); Mon, 10 May 2021 06:50:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8171061964; Mon, 10 May 2021 10:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643222; bh=vyc+nJ14+lnmbhVlGuewjiHY/sqNuE9+DBlk5Cv7qy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NEgvgswoXzZ0D63EPx0kRQPL1Y5BHOHY8xRxIv8MyUAt6CJ0v8qlzh4txPQJOYFE9 KgvHSNUxd3t5YwIT4ME3r2ZpFczzIZE75Q+EGIGF9XOw83fy8p4VmcvcIGdCM4HkKe ql0Y/tFG+Q0WuzusZD0w9h/PRpWgdmxeNUdWj/8E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Rafael J. Wysocki" , Marco Elver , "Paul E. McKenney" Subject: [PATCH 5.10 226/299] kcsan, debugfs: Move debugfs file creation out of early init Date: Mon, 10 May 2021 12:20:23 +0200 Message-Id: <20210510102012.418091716@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marco Elver commit e36299efe7d749976fbdaaf756dee6ef32543c2c upstream. Commit 56348560d495 ("debugfs: do not attempt to create a new file before the filesystem is initalized") forbids creating new debugfs files until debugfs is fully initialized. This means that KCSAN's debugfs file creation, which happened at the end of __init(), no longer works. And was apparently never supposed to work! However, there is no reason to create KCSAN's debugfs file so early. This commit therefore moves its creation to a late_initcall() callback. Cc: "Rafael J. Wysocki" Cc: stable Fixes: 56348560d495 ("debugfs: do not attempt to create a new file before the filesystem is initalized") Reviewed-by: Greg Kroah-Hartman Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney Signed-off-by: Greg Kroah-Hartman --- kernel/kcsan/core.c | 2 -- kernel/kcsan/debugfs.c | 4 +++- kernel/kcsan/kcsan.h | 5 ----- 3 files changed, 3 insertions(+), 8 deletions(-) --- a/kernel/kcsan/core.c +++ b/kernel/kcsan/core.c @@ -639,8 +639,6 @@ void __init kcsan_init(void) BUG_ON(!in_task()); - kcsan_debugfs_init(); - for_each_possible_cpu(cpu) per_cpu(kcsan_rand_state, cpu) = (u32)get_cycles(); --- a/kernel/kcsan/debugfs.c +++ b/kernel/kcsan/debugfs.c @@ -261,7 +261,9 @@ static const struct file_operations debu .release = single_release }; -void __init kcsan_debugfs_init(void) +static void __init kcsan_debugfs_init(void) { debugfs_create_file("kcsan", 0644, NULL, NULL, &debugfs_ops); } + +late_initcall(kcsan_debugfs_init); --- a/kernel/kcsan/kcsan.h +++ b/kernel/kcsan/kcsan.h @@ -31,11 +31,6 @@ void kcsan_save_irqtrace(struct task_str void kcsan_restore_irqtrace(struct task_struct *task); /* - * Initialize debugfs file. - */ -void kcsan_debugfs_init(void); - -/* * Statistics counters displayed via debugfs; should only be modified in * slow-paths. */