powerpc: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data be setup before gluing PDE to main tree. Add correct ->owner to proc_fops to fix reading/module unloading race. Signed-off-by: Denis V. Lunev <den@openvz.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cette révision appartient à :

révisé par
Linus Torvalds

Parent
6f1c86ec31
révision
667471386d
@@ -68,12 +68,11 @@ static int __init proc_ppc64_init(void)
|
||||
{
|
||||
struct proc_dir_entry *pde;
|
||||
|
||||
pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL);
|
||||
pde = proc_create_data("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL,
|
||||
&page_map_fops, vdso_data);
|
||||
if (!pde)
|
||||
return 1;
|
||||
pde->data = vdso_data;
|
||||
pde->size = PAGE_SIZE;
|
||||
pde->proc_fops = &page_map_fops;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Référencer dans un nouveau ticket
Bloquer un utilisateur