aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-05-25 23:24:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-05-25 23:24:28 -0400
commitbc2dbc5420e82560e650f8531ceca597441ca171 (patch)
treeac93448eaba1fe89fa007f9945f7e507b97dba8e /include/linux
parent03250e1028057173b212341015d5fbf53327042c (diff)
parent3f1959721558a976aaf9c2024d5bc884e6411bf7 (diff)
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "16 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: kasan: fix memory hotplug during boot kasan: free allocated shadow memory on MEM_CANCEL_ONLINE checkpatch: fix macro argument precedence test init/main.c: include <linux/mem_encrypt.h> kernel/sys.c: fix potential Spectre v1 issue mm/memory_hotplug: fix leftover use of struct page during hotplug proc: fix smaps and meminfo alignment mm: do not warn on offline nodes unless the specific node is explicitly requested mm, memory_hotplug: make has_unmovable_pages more robust mm/kasan: don't vfree() nonexistent vm_area MAINTAINERS: change hugetlbfs maintainer and update files ipc/shm: fix shmat() nil address after round-down when remapping Revert "ipc/shm: Fix shmat mmap nil-page protection" idr: fix invalid ptr dereference on item delete ocfs2: revert "ocfs2/o2hb: check len for bio_add_page() to avoid getting incorrect bio" mm: fix nr_rotate_swap leak in swapon() error case
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/linux/node.h8
2 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 1a4582b44d32..fc5ab85278d5 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -464,7 +464,7 @@ static inline struct page *
464__alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order) 464__alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order)
465{ 465{
466 VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES); 466 VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
467 VM_WARN_ON(!node_online(nid)); 467 VM_WARN_ON((gfp_mask & __GFP_THISNODE) && !node_online(nid));
468 468
469 return __alloc_pages(gfp_mask, order, nid); 469 return __alloc_pages(gfp_mask, order, nid);
470} 470}
diff --git a/include/linux/node.h b/include/linux/node.h
index 41f171861dcc..6d336e38d155 100644
--- a/include/linux/node.h
+++ b/include/linux/node.h
@@ -32,9 +32,11 @@ extern struct node *node_devices[];
32typedef void (*node_registration_func_t)(struct node *); 32typedef void (*node_registration_func_t)(struct node *);
33 33
34#if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_NUMA) 34#if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_NUMA)
35extern int link_mem_sections(int nid, unsigned long start_pfn, unsigned long nr_pages); 35extern int link_mem_sections(int nid, unsigned long start_pfn,
36 unsigned long nr_pages, bool check_nid);
36#else 37#else
37static inline int link_mem_sections(int nid, unsigned long start_pfn, unsigned long nr_pages) 38static inline int link_mem_sections(int nid, unsigned long start_pfn,
39 unsigned long nr_pages, bool check_nid)
38{ 40{
39 return 0; 41 return 0;
40} 42}
@@ -57,7 +59,7 @@ static inline int register_one_node(int nid)
57 if (error) 59 if (error)
58 return error; 60 return error;
59 /* link memory sections under this node */ 61 /* link memory sections under this node */
60 error = link_mem_sections(nid, pgdat->node_start_pfn, pgdat->node_spanned_pages); 62 error = link_mem_sections(nid, pgdat->node_start_pfn, pgdat->node_spanned_pages, true);
61 } 63 }
62 64
63 return error; 65 return error;