]> err.no Git - linux-2.6/blobdiff - mm/memory_hotplug.c
[PATCH] cpu hotplug: replace __devinit* with __cpuinit* for cpu notifications
[linux-2.6] / mm / memory_hotplug.c
index f13783e81eb6b8caefac5854477a3f0a096716cf..01c9fb97c619135edce3431d265e397f49113b58 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C)
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/mm.h>
 #include <linux/swap.h>
@@ -256,9 +255,19 @@ int add_memory(int nid, u64 start, u64 size)
        if (ret < 0)
                goto error;
 
-       /* we online node here. we have no error path from here. */
+       /* we online node here. we can't roll back from here. */
        node_set_online(nid);
 
+       if (new_pgdat) {
+               ret = register_one_node(nid);
+               /*
+                * If sysfs file of new node can't create, cpu on the node
+                * can't be hot-added. There is no rollback way now.
+                * So, check by BUG_ON() to catch it reluctantly..
+                */
+               BUG_ON(ret);
+       }
+
        /* register this memory as resource */
        register_memory_resource(start, size);