mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
Revert "pid: Replace struct pid 1-element array with flex-array"
This reverts commit5ea9dcfcd9which is commitb69f0aeb06upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: Id78fddc05ab98cf79beff0adc409fbc588f7499f Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -67,7 +67,7 @@ struct pid
|
||||
/* wait queue for pidfd notifications */
|
||||
wait_queue_head_t wait_pidfd;
|
||||
struct rcu_head rcu;
|
||||
struct upid numbers[];
|
||||
struct upid numbers[1];
|
||||
};
|
||||
|
||||
extern struct pid init_struct_pid;
|
||||
|
||||
@@ -662,11 +662,8 @@ void __init pid_idr_init(void)
|
||||
|
||||
idr_init(&init_pid_ns.idr);
|
||||
|
||||
init_pid_ns.pid_cachep = kmem_cache_create("pid",
|
||||
struct_size((struct pid *)NULL, numbers, 1),
|
||||
__alignof__(struct pid),
|
||||
SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT,
|
||||
NULL);
|
||||
init_pid_ns.pid_cachep = KMEM_CACHE(pid,
|
||||
SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT);
|
||||
}
|
||||
|
||||
static struct file *__pidfd_fget(struct task_struct *task, int fd)
|
||||
|
||||
@@ -47,7 +47,7 @@ static struct kmem_cache *create_pid_cachep(unsigned int level)
|
||||
return kc;
|
||||
|
||||
snprintf(name, sizeof(name), "pid_%u", level + 1);
|
||||
len = struct_size((struct pid *)NULL, numbers, level + 1);
|
||||
len = sizeof(struct pid) + level * sizeof(struct upid);
|
||||
mutex_lock(&pid_caches_mutex);
|
||||
/* Name collision forces to do allocation under mutex. */
|
||||
if (!*pkc)
|
||||
|
||||
Reference in New Issue
Block a user