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

From: Mark Brown <[email-masked]>
Date: Wed, 19 Jun 2024 12:31:56 +0100

Hi all,

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

/tmp/next/build/mm/hugetlb_cgroup.c: In function 'hugetlb_cgroup_cfttypes_init':
/tmp/next/build/mm/hugetlb_cgroup.c:840:42: error: 'struct cftype' has no member named 'lockdep_key'
  840 |                 lockdep_register_key(&cft->lockdep_key);
      |                                          ^~
make[4]: *** [/tmp/next/build/scripts/Makefile.build:244: mm/hugetlb_cgroup.o] Error 1

Caused by commit

  eb9290991cb59 ("mm/hugetlb_cgroup: register lockdep key for cftype")

From 2de1726235b66fe778f30b53532baaa48b284f8c Mon Sep 17 00:00:00 2001
From: Mark Brown <[email-masked]>
Date: Wed, 19 Jun 2024 12:21:59 +0100
Subject: [PATCH] mm: Fix build failure due to missing build time check

/tmp/next/build/mm/hugetlb_cgroup.c: In function 'hugetlb_cgroup_cfttypes_init':
/tmp/next/build/mm/hugetlb_cgroup.c:840:42: error: 'struct cftype' has no member named 'lockdep_key'
  840 |                 lockdep_register_key(&cft->lockdep_key);
      |                                          ^~

Signed-off-by: Mark Brown <[email-masked]>
---
 mm/hugetlb_cgroup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index 4ff238ba12503..369431160a0a8 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -837,7 +837,9 @@ hugetlb_cgroup_cfttypes_init(struct hstate *h, struct cftype *cft,
 					   MEMFILE_FIELD_SIZE(offset) * idx;
 		}
 
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
 		lockdep_register_key(&cft->lockdep_key);
+#endif
 	}
 }
 
-- 
2.39.2