diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c index 83b5c53bec6b6..8244b6b01006b 100644 --- a/drivers/xen/tmem.c +++ b/drivers/xen/tmem.c @@ -291,6 +291,10 @@ static int tmem_frontswap_store(unsigned type, pgoff_t offset, int pool = tmem_frontswap_poolid; int ret; + /* THP isn't supported */ + if (PageTransHuge(page)) + return -1; + if (pool < 0) return -1; if (ind64 != ind) diff --git a/mm/zswap.c b/mm/zswap.c index 446b8ca19afe1..eab5d6e90e577 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1079,6 +1079,12 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset, u8 *src, *dst; struct zswap_header *zhdr; + /* THP isn't supported */ + if (PageTransHuge(page)) { + ret = -EINVAL; + goto reject; + } + if (!zswap_enabled || !tree) { ret = -ENODEV; goto reject;