mm: zbud: fix condition check on allocation size
mm: zbud: fix condition check on allocation size

zbud_alloc() incorrectly verifies the size of allocation limit.  It
should deny the allocation request greater than (PAGE_SIZE -
ZHDR_SIZE_ALIGNED - CHUNK_SIZE), not (PAGE_SIZE - ZHDR_SIZE_ALIGNED)
which has no remaining spaces for its buddy.  There is no point in
spending the entire zbud page storing only a single page, since we don't
have any benefits.

Signed-off-by: Heesub Shin <45471ea77bd08f3d26635f3f5adb40ba41250a2b@samsung.com>
Acked-by: Seth Jennings <527af9e7c640877508ac9f4ddd8647c066bca6c6@linux.vnet.ibm.com>
Cc: Bob Liu <f1431bf4ea962ea2009f7275289c2e0b23d8aceb@oracle.com>
Cc: Dongjun Shin <80e36e460d3c6c0a84b627b24ca7e4def049c844@samsung.com>
Cc: Sunae Seo <d66dbc26ea8fe51816c69f464984eff7e0add320@samsung.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs