summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/z3fold.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/z3fold.c b/mm/z3fold.c
index 0d0b81637f84..64ddf864d5ee 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1803,8 +1803,11 @@ static int __init init_z3fold(void)
{
int ret;
- /* Make sure the z3fold header is not larger than the page size */
- BUILD_BUG_ON(ZHDR_SIZE_ALIGNED > PAGE_SIZE);
+ /*
+ * Make sure the z3fold header is not larger than the page size and
+ * there has remaining spaces for its buddy.
+ */
+ BUILD_BUG_ON(ZHDR_SIZE_ALIGNED > PAGE_SIZE - CHUNK_SIZE);
ret = z3fold_mount();
if (ret)
return ret;