Commit 03b83710 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] hugetlb math overflow fix

From: William Lee Irwin III <wli@holomorphy.com>

And this one fixes an overflow when there is more than 4GB of hugetlb.
parent a3efc1fa
......@@ -482,9 +482,7 @@ int hugetlb_report_meminfo(char *buf)
int is_hugepage_mem_enough(size_t size)
{
if (size > (htlbpagemem << HPAGE_SHIFT))
return 0;
return 1;
return (size + ~HPAGE_MASK)/HPAGE_SIZE <= htlbpagemem;
}
/*
......
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