staging: zcache: fix possible sleep under lock
authorSeth Jennings <sjenning@linux.vnet.ibm.com>
Mon, 22 Aug 2011 19:30:38 +0000 (14:30 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 21:49:33 +0000 (14:49 -0700)
commitdbe82eb1170c0095e0ce89676235e0b27d7040d1
treeefe3e871d6c9efd22f0484745a3dbab344231baa
parent58af58007e7bf61ba21133fa42ad2106f72a03a1
staging: zcache: fix possible sleep under lock

zcache_new_pool() calls kmalloc() with GFP_KERNEL which has
__GFP_WAIT set.  However, zcache_new_pool() gets called on
a stack that holds the swap_lock spinlock, leading to a
possible sleep-with-lock situation. The lock is obtained
in enable_swap_info().

The patch replaces GFP_KERNEL with GFP_ATOMIC.

v2: replace with GFP_ATOMIC, not GFP_IOFS

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/zcache/zcache-main.c