]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cgroup: Fix compilation issue due to cgroup_mutex not being exported
authorgaoxu <gaoxu2@honor.com>
Thu, 17 Apr 2025 07:30:00 +0000 (07:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:41:53 +0000 (14:41 +0200)
commit20fb292ab5d5d87746dbfa6d4127c50a51f93a42
treeb7223109ee8b538b6e65516ffdd5a7bea2872fc8
parentc15dc980ffc5aa4fc0e805521dcf09b29f04dcd8
cgroup: Fix compilation issue due to cgroup_mutex not being exported

[ Upstream commit 87c259a7a359e73e6c52c68fcbec79988999b4e6 ]

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 <gaoxu2@honor.com>
Acked-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/cgroup/cgroup.c