]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - mm/memory-failure.c
Merge tag 'pci-v4.13-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[karo-tx-linux.git] / mm / memory-failure.c
index ecc183fd94f36f35e91b69c6a06930bb456a7e86..dbe3e50c9aa5ea9a6bb46a3430ce04fe04b24e53 100644 (file)
@@ -684,7 +684,7 @@ static int me_pagecache_dirty(struct page *p, unsigned long pfn)
                 * the first EIO, but we're not worse than other parts
                 * of the kernel.
                 */
-               mapping_set_error(mapping, EIO);
+               mapping_set_error(mapping, -EIO);
        }
 
        return me_pagecache_clean(p, pfn);
@@ -1492,11 +1492,16 @@ EXPORT_SYMBOL(unpoison_memory);
 static struct page *new_page(struct page *p, unsigned long private, int **x)
 {
        int nid = page_to_nid(p);
-       if (PageHuge(p))
-               return alloc_huge_page_node(page_hstate(compound_head(p)),
-                                                  nid);
-       else
+       if (PageHuge(p)) {
+               struct hstate *hstate = page_hstate(compound_head(p));
+
+               if (hstate_is_gigantic(hstate))
+                       return alloc_huge_page_node(hstate, NUMA_NO_NODE);
+
+               return alloc_huge_page_node(hstate, nid);
+       } else {
                return __alloc_pages_node(nid, GFP_HIGHUSER_MOVABLE, 0);
+       }
 }
 
 /*