diff options
author | Nathan Lynch <ntl@pobox.com> | 2005-06-28 20:55:25 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-06-28 20:55:25 +1000 |
commit | f5f1cc5437961a4bd93d615099f26780819e72d3 (patch) | |
tree | 7daa443dbcb5cda9e057a818168102abe48d3b8c | |
parent | a341ad97245d01c923995cfe7deacd0c8aee6e16 (diff) |
[PATCH] ppc64: don't create spurious symlinks under node0 sysdev
On partitioned systems we can wind up creating spurious symlinks in
/sys/devices/system/node/node0 to non-present cpus. The symlinks are
not broken; the problem is that we're potentially misinforming
userspace that there is a relationship between node0 and cpus which
are to be added later. There's no guarantee at all that a cpu which
is added later will belong to node 0.
Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/ppc64/kernel/sysfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c index c8fa6569b2f..2f704a2cafb 100644 --- a/arch/ppc64/kernel/sysfs.c +++ b/arch/ppc64/kernel/sysfs.c @@ -400,7 +400,12 @@ static int __init topology_init(void) struct cpu *c = &per_cpu(cpu_devices, cpu); #ifdef CONFIG_NUMA - parent = &node_devices[cpu_to_node(cpu)]; + /* The node to which a cpu belongs can't be known + * until the cpu is made present. + */ + parent = NULL; + if (cpu_present(cpu)) + parent = &node_devices[cpu_to_node(cpu)]; #endif /* * For now, we just see if the system supports making |