Skip to content

Commit 6657719

Browse files
author
Al Viro
committed
make sure that nsproxy_cache is initialized early enough
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 1ba1068 commit 6657719

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎include/linux/nsproxy.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
6868
void free_nsproxy(struct nsproxy *ns);
6969
int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
7070
struct fs_struct *);
71+
int __init nsproxy_cache_init(void);
7172

7273
static inline void put_nsproxy(struct nsproxy *ns)
7374
{

‎kernel/fork.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,7 @@ void __init proc_caches_init(void)
15741574
SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL);
15751575
vm_area_cachep = KMEM_CACHE(vm_area_struct, SLAB_PANIC);
15761576
mmap_init();
1577+
nsproxy_cache_init();
15771578
}
15781579

15791580
/*

‎kernel/nsproxy.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,8 @@ SYSCALL_DEFINE2(setns, int, fd, int, nstype)
271271
return err;
272272
}
273273

274-
static int __init nsproxy_cache_init(void)
274+
int __init nsproxy_cache_init(void)
275275
{
276276
nsproxy_cachep = KMEM_CACHE(nsproxy, SLAB_PANIC);
277277
return 0;
278278
}
279-
280-
module_init(nsproxy_cache_init);

0 commit comments

Comments
 (0)