Subject: linux-next: build failure after merge of the mm tree

From: Stephen Rothwell <[email-masked]>
Date: Thu, 15 Aug 2024 09:57:34 +1000

Hi all,

After merging the mm tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

drivers/nvme/host/fault_inject.c: In function 'nvme_fault_inject_init':
drivers/nvme/host/fault_inject.c:29:18: error: implicit declaration of function 'debugfs_create_dir'; did you mean 'kernfs_create_dir'? [-Werror=implicit-function-declaration]
   29 |         parent = debugfs_create_dir(dev_name, NULL);
      |                  ^~~~~~~~~~~~~~~~~~
      |                  kernfs_create_dir
drivers/nvme/host/fault_inject.c:29:16: error: assignment to 'struct dentry *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
   29 |         parent = debugfs_create_dir(dev_name, NULL);
      |                ^
drivers/nvme/host/fault_inject.c:39:17: error: implicit declaration of function 'debugfs_remove_recursive' [-Werror=implicit-function-declaration]
   39 |                 debugfs_remove_recursive(parent);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/nvme/host/fault_inject.c:47:9: error: implicit declaration of function 'debugfs_create_x16' [-Werror=implicit-function-declaration]
   47 |         debugfs_create_x16("status", 0600, dir, &fault_inj->status);
      |         ^~~~~~~~~~~~~~~~~~
drivers/nvme/host/fault_inject.c:48:9: error: implicit declaration of function 'debugfs_create_bool'; did you mean 'kernfs_create_root'? [-Werror=implicit-function-declaration]
   48 |         debugfs_create_bool("dont_retry", 0600, dir, &fault_inj->dont_retry);
      |         ^~~~~~~~~~~~~~~~~~~
      |         kernfs_create_root
cc1: all warnings being treated as errors
drivers/iommu/iommufd/selftest.c: In function 'iommufd_test_init':
drivers/iommu/iommufd/selftest.c:1562:9: error: implicit declaration of function 'debugfs_remove_recursive' [-Werror=implicit-function-declaration]
 1562 |         debugfs_remove_recursive(dbgfs_root);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
kernel/futex/core.c: In function 'fail_futex_debugfs':
kernel/futex/core.c:98:9: error: implicit declaration of function 'debugfs_create_bool'; did you mean 'kernfs_create_root'? [-Werror=implicit-function-declaration]
   98 |         debugfs_create_bool("ignore-private", mode, dir,
      |         ^~~~~~~~~~~~~~~~~~~
      |         kernfs_create_root
cc1: all warnings being treated as errors
mm/fail_page_alloc.c: In function 'fail_page_alloc_debugfs':
mm/fail_page_alloc.c:57:9: error: implicit declaration of function 'debugfs_create_bool'; did you mean 'kernfs_create_root'? [-Werror=implicit-function-declaration]
   57 |         debugfs_create_bool("ignore-gfp-wait", mode, dir,
      |         ^~~~~~~~~~~~~~~~~~~
      |         kernfs_create_root
mm/fail_page_alloc.c:61:9: error: implicit declaration of function 'debugfs_create_u32' [-Werror=implicit-function-declaration]
   61 |         debugfs_create_u32("min-order", mode, dir, &fail_page_alloc.min_order);
      |         ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
mm/failslab.c: In function 'failslab_debugfs_init':
mm/failslab.c:65:9: error: implicit declaration of function 'debugfs_create_bool'; did you mean 'kernfs_create_root'? [-Werror=implicit-function-declaration]
   65 |         debugfs_create_bool("ignore-gfp-wait", mode, dir,
      |         ^~~~~~~~~~~~~~~~~~~
      |         kernfs_create_root
cc1: all warnings being treated as errors
lib/fault-inject.c: In function 'debugfs_create_ul':
lib/fault-inject.c:186:9: error: implicit declaration of function 'debugfs_create_file'; did you mean 'debugfs_create_ul'? [-Werror=implicit-function-declaration]
  186 |         debugfs_create_file(name, mode, parent, value, &fops_ul);
      |         ^~~~~~~~~~~~~~~~~~~
      |         debugfs_create_ul
lib/fault-inject.c: In function 'fault_create_debugfs_attr':
lib/fault-inject.c:217:15: error: implicit declaration of function 'debugfs_create_dir'; did you mean 'debugfs_create_ul'? [-Werror=implicit-function-declaration]
  217 |         dir = debugfs_create_dir(name, parent);
      |               ^~~~~~~~~~~~~~~~~~
      |               debugfs_create_ul
lib/fault-inject.c:217:13: error: assignment to 'struct dentry *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
  217 |         dir = debugfs_create_dir(name, parent);
      |             ^
lib/fault-inject.c:223:9: error: implicit declaration of function 'debugfs_create_atomic_t'; did you mean 'debugfs_create_ul'? [-Werror=implicit-function-declaration]
  223 |         debugfs_create_atomic_t("times", mode, dir, &attr->times);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         debugfs_create_ul
lib/fault-inject.c:226:9: error: implicit declaration of function 'debugfs_create_u32'; did you mean 'debugfs_create_ul'? [-Werror=implicit-function-declaration]
  226 |         debugfs_create_u32("verbose_ratelimit_interval_ms", mode, dir,
      |         ^~~~~~~~~~~~~~~~~~
      |         debugfs_create_ul
lib/fault-inject.c:230:9: error: implicit declaration of function 'debugfs_create_bool'; did you mean 'debugfs_create_ul'? [-Werror=implicit-function-declaration]
  230 |         debugfs_create_bool("task-filter", mode, dir, &attr->task_filter);
      |         ^~~~~~~~~~~~~~~~~~~
      |         debugfs_create_ul
lib/fault-inject.c:235:9: error: implicit declaration of function 'debugfs_create_xul'; did you mean 'debugfs_create_ul'? [-Werror=implicit-function-declaration]
  235 |         debugfs_create_xul("require-start", mode, dir, &attr->require_start);
      |         ^~~~~~~~~~~~~~~~~~
      |         debugfs_create_ul
cc1: all warnings being treated as errors

Caused by commit

  2771559a5531 ("fault-inject: improve build for CONFIG_FAULT_INJECTION=n")

This is just whack-a-mole ... :-(

I have applied the following patch for today.

From: Stephen Rothwell <[email-masked]>
Date: Thu, 15 Aug 2024 09:47:30 +1000
Subject: [PATCH] fix up for "fault-inject: improve build for CONFIG_FAULT_INJECTION=n"

Signed-off-by: Stephen Rothwell <[email-masked]>
---
 drivers/iommu/iommufd/selftest.c | 1 +
 drivers/nvme/host/fault_inject.c | 1 +
 kernel/futex/core.c              | 1 +
 lib/fault-inject.c               | 1 +
 mm/fail_page_alloc.c             | 1 +
 mm/failslab.c                    | 1 +
 6 files changed, 6 insertions(+)

diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c
index f95e32e29133..d9024c00c6c3 100644
--- a/drivers/iommu/iommufd/selftest.c
+++ b/drivers/iommu/iommufd/selftest.c
@@ -8,6 +8,7 @@
 #include <linux/xarray.h>
 #include <linux/file.h>
 #include <linux/anon_inodes.h>
+#include <linux/debugfs.h>
 #include <linux/fault-inject.h>
 #include <linux/platform_device.h>
 #include <uapi/linux/iommufd.h>
diff --git a/drivers/nvme/host/fault_inject.c b/drivers/nvme/host/fault_inject.c
index 1d1b6441a339..105d6cb41c72 100644
--- a/drivers/nvme/host/fault_inject.c
+++ b/drivers/nvme/host/fault_inject.c
@@ -6,6 +6,7 @@
  */
 
 #include <linux/moduleparam.h>
+#include <linux/debugfs.h>
 #include "nvme.h"
 
 static DECLARE_FAULT_ATTR(fail_default_attr);
diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index 06a1f091be81..f7cddf321593 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -36,6 +36,7 @@
 #include <linux/pagemap.h>
 #include <linux/plist.h>
 #include <linux/memblock.h>
+#include <linux/debugfs.h>
 #include <linux/fault-inject.h>
 #include <linux/slab.h>
 
diff --git a/lib/fault-inject.c b/lib/fault-inject.c
index d608f9b48c10..d5853defe77a 100644
--- a/lib/fault-inject.c
+++ b/lib/fault-inject.c
@@ -9,6 +9,7 @@
 #include <linux/export.h>
 #include <linux/interrupt.h>
 #include <linux/stacktrace.h>
+#include <linux/debugfs.h>
 #include <linux/fault-inject.h>
 
 /*
diff --git a/mm/fail_page_alloc.c b/mm/fail_page_alloc.c
index 532851ce5132..4c7aa18450c9 100644
--- a/mm/fail_page_alloc.c
+++ b/mm/fail_page_alloc.c
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <linux/debugfs.h>
 #include <linux/fault-inject.h>
 #include <linux/error-injection.h>
 #include <linux/mm.h>
diff --git a/mm/failslab.c b/mm/failslab.c
index af16c2ed578f..4b02bc8b420e 100644
--- a/mm/failslab.c
+++ b/mm/failslab.c
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <linux/debugfs.h>
 #include <linux/fault-inject.h>
 #include <linux/error-injection.h>
 #include <linux/slab.h>
-- 
2.43.0

-- 
Cheers,
Stephen Rothwell