Commit c6325b07 authored by Isaac J. Manjarres's avatar Isaac J. Manjarres Committed by Treehugger Robot
Browse files

ANDROID: cgroup: Fix cgroup_root backport padding calculation



ANDROID_BACKPORT_USE_ARRAY() needs to reserve enough space to fit a
struct rcu_head at a minimum, and it reserves enough space for
CGROUP_SUBSYS_COUNT atomic_ts.

This works well on kernel configurations where the number of
CGROUP_SUBSYS_COUNT is big enough to cause more space than what is
needed for struct rcu_head to be reserved. However, for kernel
configurations where CGROUP_SUBSYS_COUNT is too small and doesn't
reserve enough space, the following build error is triggered:

error: static assertion failed due to requirement
'sizeof(struct cgroup_root::(unnamed ...) <= sizeof(struct cgroup_root::(unnamed at ...))':
struct callback_head rcu is larger than u8 __attribute__((__aligned__(8))) android_backport_reserved1[CGROUP_SUBSYS_COUNT * sizeof(atomic_t)]

Instead of assuming CGROUP_SUBSYS_COUNT is large enough, given that the
minimum size if the size of struct rcu_head, always make sure that
much space is reserved if CGROUP_SUBSYS_COUNT is too small.

Bug: 422866230
Fixes: d66e9166 ("ANDROID: fix ABI-break in struct cgroup_root")
Change-Id: Ib34c9249c05c4ecfbf9c6d18b613afdd7dff5cb2
Signed-off-by: default avatarIsaac J. Manjarres <isaacmanjarres@google.com>
parent 452d899d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment