]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - mm/vmalloc.c
Merge branch 'rebased-statx' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[mirror_ubuntu-artful-kernel.git] / mm / vmalloc.c
index 3ca82d44edd344a2800b8029f5d6e1d27d8d528b..b4024d688f38698bdbea86034e9a72f71f052da4 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/highmem.h>
-#include <linux/sched.h>
+#include <linux/sched/signal.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
@@ -1642,6 +1642,11 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
        for (i = 0; i < area->nr_pages; i++) {
                struct page *page;
 
+               if (fatal_signal_pending(current)) {
+                       area->nr_pages = i;
+                       goto fail;
+               }
+
                if (node == NUMA_NO_NODE)
                        page = alloc_page(alloc_mask);
                else
@@ -1662,7 +1667,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
        return area->addr;
 
 fail:
-       warn_alloc(gfp_mask,
+       warn_alloc(gfp_mask, NULL,
                          "vmalloc: allocation failure, allocated %ld of %ld bytes",
                          (area->nr_pages*PAGE_SIZE), area->size);
        vfree(area->addr);
@@ -1724,7 +1729,7 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
        return addr;
 
 fail:
-       warn_alloc(gfp_mask,
+       warn_alloc(gfp_mask, NULL,
                          "vmalloc: allocation failure: %lu bytes", real_size);
        return NULL;
 }
@@ -2309,7 +2314,7 @@ EXPORT_SYMBOL_GPL(free_vm_area);
 #ifdef CONFIG_SMP
 static struct vmap_area *node_to_va(struct rb_node *n)
 {
-       return n ? rb_entry(n, struct vmap_area, rb_node) : NULL;
+       return rb_entry_safe(n, struct vmap_area, rb_node);
 }
 
 /**
@@ -2654,7 +2659,7 @@ static int s_show(struct seq_file *m, void *p)
                seq_printf(m, " pages=%d", v->nr_pages);
 
        if (v->phys_addr)
-               seq_printf(m, " phys=%llx", (unsigned long long)v->phys_addr);
+               seq_printf(m, " phys=%pa", &v->phys_addr);
 
        if (v->flags & VM_IOREMAP)
                seq_puts(m, " ioremap");