From patchwork Wed Jul 14 11:31:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weizhao Ouyang X-Patchwork-Id: 12376729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26B58C07E9A for ; Wed, 14 Jul 2021 11:31:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AAB3A6100A for ; Wed, 14 Jul 2021 11:31:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAB3A6100A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DBFC66B0083; Wed, 14 Jul 2021 07:31:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D6FA66B0085; Wed, 14 Jul 2021 07:31:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC25F6B0088; Wed, 14 Jul 2021 07:31:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0077.hostedemail.com [216.40.44.77]) by kanga.kvack.org (Postfix) with ESMTP id 8D90C6B0083 for ; Wed, 14 Jul 2021 07:31:48 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 84F6980D7961 for ; Wed, 14 Jul 2021 11:31:47 +0000 (UTC) X-FDA: 78360978654.01.3A4EEF8 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf01.hostedemail.com (Postfix) with ESMTP id 44AEB500AA95 for ; Wed, 14 Jul 2021 11:31:47 +0000 (UTC) Received: by mail-pj1-f51.google.com with SMTP id g6-20020a17090adac6b029015d1a9a6f1aso3443251pjx.1 for ; Wed, 14 Jul 2021 04:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xzP9JfDqYJBn+lgkJ5neqY7O14ZLPqoi6I2YFgNMZsE=; b=qBF4f564yxbWbWqj3DG79Ntsuw4R0D0YUsnc3p57YClIF0HU4FoYWd4L04VW6zNbKz nzf+9Ii61rc06s7ea290CU4F+loflLIeD9D2WZCaCOxOvcrfiXzCb3BZdpyZGA0rV+GS LKoFeDqsLVf3ymERmKofS77J9XOaCFUdOzkfhBhO98OFh01WDTz2Eaq3iUgRCjiEB8WE cJm9ScsEwFCD0BwkXbfoCwtX4yeHV1oI9oFe8Hoq09Y02HW4ng18DMAw7nkIl4d6GWoe j5T+xZ8W0iH0871WC8/fwdY/3Ju98o2rlYUOAJcbkwy4GJty6/crOizpfXyIcdL9AtUq Miow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xzP9JfDqYJBn+lgkJ5neqY7O14ZLPqoi6I2YFgNMZsE=; b=FmJKsl5C38uIQAYGi5XS1ybgn/3aNiFtbyEBg9DwiuyJdiI1YVxfwhg64iNBoXLiTf X46Xe2b2JlFcByeCoEFh+ytuuVM066d7DXd4+CsXAZB4BpZnuZNfiUqDUGARhC89hy05 ZSqKExCTp7gdM3/hhVTYypT1e+YTimm57cCRBELqYDVKhQE/+f4Lrp83+4pZ07Ux1IO6 nFIM4BmkgowNgnj/EkQcnulcsDiGyzSgqVmMFlCpWoFyyvSSUxE+dKsjvLhdkcqX9Px8 Sd84qFEbNp8b6rLZfmmgXFMgntYTQot0/S+Kr/KrCxKTVviqPQBI6X/Hf/yb/BTWBkuJ HLMQ== X-Gm-Message-State: AOAM533G9PyNQR0XK9RA0u6i71YMjatg6/ttqd4SnexpzIhzGdy0Yetq BjQxkGdei5iRQm9h4OEb7lQ= X-Google-Smtp-Source: ABdhPJwFeuyNMZp1zLa0XAcShrXvkzNL7Gx0wUMWfX8C7tekIfM5jkADKNozUqFglIRoEhMO0shcaA== X-Received: by 2002:a17:90a:6be1:: with SMTP id w88mr9400355pjj.121.1626262306372; Wed, 14 Jul 2021 04:31:46 -0700 (PDT) Received: from ownia.. ([173.248.225.217]) by smtp.gmail.com with ESMTPSA id r15sm2830316pgk.72.2021.07.14.04.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 04:31:46 -0700 (PDT) From: Weizhao Ouyang To: glider@google.com, elver@google.com, dvyukov@google.com, akpm@linux-foundation.org Cc: kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Weizhao Ouyang Subject: [PATCH] kfence: defer kfence_test_init to ensure that kunit debugfs is created Date: Wed, 14 Jul 2021 19:31:40 +0800 Message-Id: <20210714113140.2949995-1-o451686892@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 44AEB500AA95 X-Stat-Signature: wpx5oraiq5t1stnr9ngodjmrrcjgbkdn Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=qBF4f564; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of o451686892@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=o451686892@gmail.com X-HE-Tag: 1626262307-224273 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000178, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: kfence_test_init and kunit_init both use the same level late_initcall, which means if kfence_test_init linked ahead of kunit_init, kfence_test_init will get a NULL debugfs_rootdir as parent dentry, then kfence_test_init and kfence_debugfs_init both create a debugfs node named "kfence" under debugfs_mount->mnt_root, and it will throw out "debugfs: Directory 'kfence' with parent '/' already present!" with EEXIST. So kfence_test_init should be deferred. Signed-off-by: Weizhao Ouyang Tested-by: Marco Elver --- mm/kfence/kfence_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c index 7f24b9bcb2ec..942cbc16ad26 100644 --- a/mm/kfence/kfence_test.c +++ b/mm/kfence/kfence_test.c @@ -852,7 +852,7 @@ static void kfence_test_exit(void) tracepoint_synchronize_unregister(); } -late_initcall(kfence_test_init); +late_initcall_sync(kfence_test_init); module_exit(kfence_test_exit); MODULE_LICENSE("GPL v2");