slab: correctly handle __GFP_ZERO
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 24 Jul 2007 19:02:40 +0000 (12:02 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 24 Jul 2007 19:24:59 +0000 (12:24 -0700)
Use the correct local variable when calling into the page allocator.  Local
`flags' can have __GFP_ZERO set, which causes us to pass __GFP_ZERO into the
page allocator, possibly from illegal contexts.  The page allocator will later
do prep_zero_page()->kmap_atomic(..., KM_USER0) from irq contexts and will
then go BUG.

Cc: Mike Galbraith <efault@gmx.de>
Acked-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slab.c

index bde271c001ba33ef1f61dd0f563f74d319cd1f0e..a684778b2b41af38e06aa47e5fe66a7a988ad4c7 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2776,7 +2776,7 @@ static int cache_grow(struct kmem_cache *cachep,
         * 'nodeid'.
         */
        if (!objp)
-               objp = kmem_getpages(cachep, flags, nodeid);
+               objp = kmem_getpages(cachep, local_flags, nodeid);
        if (!objp)
                goto failed;