Commit 80976804 authored by Seth Jennings's avatar Seth Jennings Committed by Linus Torvalds

staging: zcache: fix cleancache crash

After commit c5f5c4db ("staging: zcache: fix crash on high memory
swap") cleancache crashes on the first successful get.  This was caused
by a remaining virt_to_page() call in zcache_pampd_get_data_and_free()
that only gets run in the cleancache path.

The patch converts the virt_to_page() to struct page casting like was
done for other instances in c5f5c4db.
Signed-off-by: default avatarSeth Jennings <sjenning@linux.vnet.ibm.com>
Tested-By: default avatarValdis Kletnieks <valdis.kletnieks@vt.edu>
Acked-by: default avatarDan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2838888f
...@@ -1242,7 +1242,7 @@ static int zcache_pampd_get_data_and_free(char *data, size_t *bufsize, bool raw, ...@@ -1242,7 +1242,7 @@ static int zcache_pampd_get_data_and_free(char *data, size_t *bufsize, bool raw,
int ret = 0; int ret = 0;
BUG_ON(!is_ephemeral(pool)); BUG_ON(!is_ephemeral(pool));
zbud_decompress(virt_to_page(data), pampd); zbud_decompress((struct page *)(data), pampd);
zbud_free_and_delist((struct zbud_hdr *)pampd); zbud_free_and_delist((struct zbud_hdr *)pampd);
atomic_dec(&zcache_curr_eph_pampd_count); atomic_dec(&zcache_curr_eph_pampd_count);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment