• Seth Jennings's avatar
    staging: zcache: fix crash on high memory swap · c5f5c4db
    Seth Jennings authored
    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: default avatarSeth Jennings <sjenning@linux.vnet.ibm.com>
    Acked-by: default avatarDan Magenheimer <dan.magenheimer@oracle.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    c5f5c4db
zcache-main.c 53.5 KB