Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2554550pxj; Mon, 10 May 2021 05:49:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqAqX94Sj+djwLKug9HZyq+KYf1mRPvgNhqu12UBzf42LtpOsmzJZ0PvxB9Z2eY7Ol8c1W X-Received: by 2002:a50:a404:: with SMTP id u4mr29308496edb.112.1620650986215; Mon, 10 May 2021 05:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620650986; cv=none; d=google.com; s=arc-20160816; b=AVaBbJT9YGzRLfXTwDduQQS+2JMkKr0MnxiwSx6gVwdeZfIW0S9R3qw0Xk0jPume/e 4wHDssyiXbxK8XTMvzmN/r89YRGZwCxXxtCjeRF452la2d0JH9ZLEb5LAdZ/Ked4LgG5 RtlPbesB0mKy6ZqFV9eZmd0EA7aE5mPyymZ4NGWivTzwBxt/PS5MTpaKbdUx2E+f9ud4 Mt+AdhIgWT1KUNwrWlQ7dJxM5SkS8spz7Tg+zG1sEBxST4eo9x3l6ymztC9fTGkooqGi Rb/GpGfch02A3go4Gg53sxAa8jgYvIBlE5PumCJQ9Vew6Vg8KFLzp8mrLhc32Q/q2AE1 F+aw== 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=DHPk1GBmdZbvPTtDcM1EJet33nW00zzbhbOsvfXV0dkQnQ/C0R259RzaGYk0tZERub Y3L4SUL9ti0BoetYW/yYZDBqo0iRTLVB1rLnwZBnsdYZJNgy+rn2jEWhz+QGLY8Ua4Zg nOgXMHbk6ymehzoRiUg6wW1wMts1ytHYBJl67iIB/PWCLK6QrqpIlE2y6TIKf4zBEPDe 9ay/emw43MyMwZ87eeA9NROdoeBvEVXAtO0qK1tUvZigjWIXUW/1MiPiXTCNBqqg3VR/ PwJs97ijFbAPB0i8mQrbkPETJmf/dH/fonS5zioU5GMtyNFR02GZO0hRqEYEV4dp/mTt 1zXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FAmzthEO; 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 e1si12775749edk.506.2021.05.10.05.49.15; Mon, 10 May 2021 05:49:46 -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=FAmzthEO; 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 S1346996AbhEJMdI (ORCPT + 99 others); Mon, 10 May 2021 08:33:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:46208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231712AbhEJLLv (ORCPT ); Mon, 10 May 2021 07:11:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6364461926; Mon, 10 May 2021 11:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620644951; bh=vyc+nJ14+lnmbhVlGuewjiHY/sqNuE9+DBlk5Cv7qy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FAmzthEONGFa29oVMdRhH3xq8mqGu+ZvPzbg2jfvFguYxLatSkYp8TQfa1TurzfTr kKmE6D00+JesK5EJfnSAvJCmIEzWrF1wmEpZB2mCz3xI+k0YWq/CEgkBWhDtTIfiXV ov2/WyPvN3ndsb+5PxbKB4G8L/kKfyyYpG8fbeaA= 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.12 290/384] kcsan, debugfs: Move debugfs file creation out of early init Date: Mon, 10 May 2021 12:21:19 +0200 Message-Id: <20210510102024.371707888@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102014.849075526@linuxfoundation.org> References: <20210510102014.849075526@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. */