aboutsummaryrefslogtreecommitdiffstats
path: root/mm/dmapool.c
diff options
context:
space:
mode:
authorYuri Tikhonov <yur@emcraft.com>2009-04-13 14:40:11 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-13 15:04:32 -0700
commit61609d01cbb3ab865c8cccaf85e6837c47096480 (patch)
tree144e176568328a6fcd9c01853c3f88fd6bc1a08e /mm/dmapool.c
parentintelfb: support i854 (diff)
downloadlinux-dev-61609d01cbb3ab865c8cccaf85e6837c47096480.tar.xz
linux-dev-61609d01cbb3ab865c8cccaf85e6837c47096480.zip
shmem: fix division by zero
Fix a division by zero which we have in shmem_truncate_range() and shmem_unuse_inode() when using big PAGE_SIZE values (e.g. 256kB on ppc44x). With 256kB PAGE_SIZE, the ENTRIES_PER_PAGEPAGE constant becomes too large (0x1.0000.0000) on a 32-bit kernel, so this patch just changes its type from 'unsigned long' to 'unsigned long long'. Hugh: reverted its unsigned long longs in shmem_truncate_range() and shmem_getpage(): the pagecache index cannot be more than an unsigned long, so the divisions by zero occurred in unreached code. It's a pity we need any ULL arithmetic here, but I found no pretty way to avoid it. Signed-off-by: Yuri Tikhonov <yur@emcraft.com> Signed-off-by: Hugh Dickins <hugh@veritas.com> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/dmapool.c')
0 files changed, 0 insertions, 0 deletions