From 912caa45597361a5da45ae8f8b99fad9d45a27e0 Mon Sep 17 00:00:00 2001 From: gao xu Date: Thu, 17 Apr 2025 15:08:47 +0800 Subject: [PATCH] FROMLIST: cgroup: Fix compilation issue due to cgroup_mutex not being exported When adding folio_memcg function call in the zram module for Android16-6.12, the following error occurs during compilation: ERROR: modpost: "cgroup_mutex" [../soc-repo/zram.ko] undefined! This error is caused by the indirect call to lockdep_is_held(&cgroup_mutex) within folio_memcg. The export setting for cgroup_mutex is controlled by the CONFIG_PROVE_RCU macro. If CONFIG_LOCKDEP is enabled while CONFIG_PROVE_RCU is not, this compilation error will occur. To resolve this issue, add a parallel macro CONFIG_LOCKDEP control to ensure cgroup_mutex is properly exported when needed. Signed-off-by: gao xu Bug: 409264079 Link: https://lore.kernel.org/cgroups/24763f5c8a13421fa6dc3672a57a7836@honor.com/T/#u Change-Id: I5d31371cb216b9aee6eedd5b5e5535ee01d7871d Signed-off-by: yipeng xiang --- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 3f761c259a0d..9caa02bd378f 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -93,7 +93,7 @@ DEFINE_MUTEX(cgroup_mutex); DEFINE_SPINLOCK(css_set_lock); -#ifdef CONFIG_PROVE_RCU +#if (defined CONFIG_PROVE_RCU || defined CONFIG_LOCKDEP) EXPORT_SYMBOL_GPL(cgroup_mutex); EXPORT_SYMBOL_GPL(css_set_lock); #endif