]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/seq_file.c
Fix signed/unsigned pointer warning
[mirror_ubuntu-artful-kernel.git] / fs / seq_file.c
index 353948ba1c5b2d2ed08ead3448fb9218cbb89f96..dbf3a59c86bbbb081464830585f216623ab9f112 100644 (file)
@@ -25,7 +25,11 @@ static void *seq_buf_alloc(unsigned long size)
 {
        void *buf;
 
-       buf = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
+       /*
+        * __GFP_NORETRY to avoid oom-killings with high-order allocations -
+        * it's better to fall back to vmalloc() than to kill things.
+        */
+       buf = kmalloc(size, GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN);
        if (!buf && size > PAGE_SIZE)
                buf = vmalloc(size);
        return buf;