Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp306473pxv; Wed, 14 Jul 2021 04:33:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx04rpcgjXhEdTmAgHD6h2PxXU5FS689eJZ4re2dG7nhomBzY3/7Pc93mU9yXnyXCafvcwh X-Received: by 2002:a92:d28b:: with SMTP id p11mr6696833ilp.250.1626262427873; Wed, 14 Jul 2021 04:33:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626262427; cv=none; d=google.com; s=arc-20160816; b=bn1I4e1aUu78e2hyHSzyUzEIpozarrNMsibVgnB4BeXdNY20vLIETKSZE+fWKv7Nxu EdRxePhFH8r/jyCFm8mv/FYDeSjAWTtn4fy8BRnU17FQIyhX91F2aeeV+IR3cv0GEob5 t84v4UMkym7Lk7ws8uMUcQ+bpEtkA+aWCeLjY6kc3Hh5tphxPrsSttXLy0jXNTBxv/Qk acdR5k1zHVUouua+w2U7qIh6AECs9cYveH0itx7aiKCvCUop01XBSRD2y9Lae7/4kQ9Z aaXnIThTk8TuUmf0zYYl+GdAvo8qytE3TUH16Hi1Nc5IeCMSzUYuIu43e3LkF96S5Hfc Ezyg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=xzP9JfDqYJBn+lgkJ5neqY7O14ZLPqoi6I2YFgNMZsE=; b=ynsCW9wCK0BLqDbXuG4l0INOwOmXpkcdn9osbEMVENUP+5eubswMxRw8Tz+tIlZCo2 Me3Y7QT9GNusFxDgQD7ZX+f9lanSz7Azj0lL9pPqf3hT40lIc3ffcpiscn8e1Yncw+CD 0i8oiRiT0H3uS5Z97KOGy8VMkKEaB7B+Zs7KgiTOY+J5fOdkIbnbUrDpDv06hUcTUO60 6GA0gPg5wL3WWzGsISIq10uxPAJbEEaH+WRJ/Zsc5dLEX88DeEoNNfrTGeDCHSGWeDXY yIKbkDWrQdJFkPgjhTiAES3Brt7+M6r5Tu1IUs6LNQP34JhhYihruhpcR9twWPejWEJq Tq+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qBF4f564; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si1966775ilj.38.2021.07.14.04.33.35; Wed, 14 Jul 2021 04:33:47 -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=@gmail.com header.s=20161025 header.b=qBF4f564; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238362AbhGNLek (ORCPT + 99 others); Wed, 14 Jul 2021 07:34:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230451AbhGNLej (ORCPT ); Wed, 14 Jul 2021 07:34:39 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B80C06175F for ; Wed, 14 Jul 2021 04:31:46 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id h1so1332800plf.6 for ; Wed, 14 Jul 2021 04:31:46 -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=k3TcGt/jNSatZ2mbBrwFR6lwzdvxuwLSj8zPrfq52zHx27jo81ayrKQT2xB2mO+nZ8 mgYRmmUxhaWCzIyzBPNhRBTj2DXrtGKXEd8GlBdLN26aKFRRw6fKcnr95ADliNPlUVh8 YHtLChOf+5mjeb06xo045tWjIM2kBJW2d3ZNeYNNZHok1Ew806WLCWKJR1X/CDhS4hd9 2nDyEnNCRjMymINmuW+blmThnjTpM37USJkvOUWbmjsZzvgOem2vW64fICVVViHzRJxk SHLdyYUlavoFinMEbEEFLAU6rFoOEPdDr5Bt6x1sxrc6mExwYhv01ErF0zwYrL8DmPRI Io5A== X-Gm-Message-State: AOAM533jnv/RYdK8iafn2BO2gJUR0oX7jrb4ihxQdHUynIcQcXUAB5Ud lOtplu2JNTv4YDaq9D/isYo= 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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"); -- 2.30.2