]> git.hungrycats.org Git - linux/commit
[PATCH] calculate NGROUPS_PER_BLOCK from PAGE_SIZE
authorAndrew Morton <akpm@osdl.org>
Sat, 15 May 2004 03:21:48 +0000 (20:21 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 15 May 2004 03:21:48 +0000 (20:21 -0700)
commit7dd692fc712b84d7d882f23f17af9626afe28b50
treee339faccdcca11a35ed383b5c45f955c0fe89c57
parentee4c48c066c1aa2e6f34decf4ad15a3a32952c6a
[PATCH] calculate NGROUPS_PER_BLOCK from PAGE_SIZE

From: Greg Edwards <edwardsg@sgi.com>

On ia64, EXEC_PAGESIZE (max page size) is 65536, but the default page size is
16k.  This results in NGROUPS_PER_BLOCK in include/linux/sched.h being
calculated incorrectly when the page size is anything other than 64k.  For
example, on a 16k page size kernel, a setgroups() call with a gidsetsize of
65536 will end up walking over memory since only 1/4 of the needed pages were
allocated for the blocks[] array in the group_info struct.

Patch below calculates NGROUPS_PER_BLOCK from PAGE_SIZE instead.
include/linux/sched.h