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>
这个提交包含在:
@@ -512,12 +512,9 @@ static int proc_ppc64_create_ofdt(void)
|
||||
if (!machine_is(pseries))
|
||||
return 0;
|
||||
|
||||
ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL);
|
||||
if (ent) {
|
||||
ent->data = NULL;
|
||||
ent = proc_create("ppc64/ofdt", S_IWUSR, NULL, &ofdt_fops);
|
||||
if (ent)
|
||||
ent->size = 0;
|
||||
ent->proc_fops = &ofdt_fops;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
在新工单中引用
屏蔽一个用户