staging: zcache: fix crash on high memory swap
authorSeth Jennings <sjenning@linux.vnet.ibm.com>
Wed, 10 Aug 2011 17:56:49 +0000 (12:56 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 21:52:20 +0000 (14:52 -0700)
commitc5f5c4db393837ebb2ae47bf061d70e498f48f8c
treee3b8823d57cd884d19ce2c98647ea32bd9b01a9c
parent20cc7995fe66ce6417678bb0db6b3d4955fb1ff6
staging: zcache: fix crash on high memory swap

zcache_put_page() was modified to pass page_address(page) instead of the
actual page structure. In combination with the function signature changes
to tmem_put() and zcache_pampd_create(), zcache_pampd_create() tries to
(re)derive the page structure from the virtual address.  However, if the
original page is a high memory page (or any unmapped page), this
virt_to_page() fails because the page_address() in zcache_put_page()
returned NULL.

This patch changes zcache_put_page() and zcache_get_page() to pass
the page structure instead of the page's virtual address, which
may or may not exist.

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