diff options
-rw-r--r-- | mm/zswap.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mm/zswap.c b/mm/zswap.c index 7d34e69507e3..cd91fd9d96b8 100644 --- a/mm/zswap.c +++ b/mm/zswap.c | |||
@@ -1026,6 +1026,15 @@ static int zswap_frontswap_store(unsigned type, pgoff_t offset, | |||
1026 | ret = -ENOMEM; | 1026 | ret = -ENOMEM; |
1027 | goto reject; | 1027 | goto reject; |
1028 | } | 1028 | } |
1029 | |||
1030 | /* A second zswap_is_full() check after | ||
1031 | * zswap_shrink() to make sure it's now | ||
1032 | * under the max_pool_percent | ||
1033 | */ | ||
1034 | if (zswap_is_full()) { | ||
1035 | ret = -ENOMEM; | ||
1036 | goto reject; | ||
1037 | } | ||
1029 | } | 1038 | } |
1030 | 1039 | ||
1031 | /* allocate entry */ | 1040 | /* allocate entry */ |