https://github.com/torvalds/linux
Revision caefba1740d8016e6dfe8fda84f85bdcb8f8c85d authored by Hugh Dickins on 13 April 2009, 21:40:12 UTC, committed by Linus Torvalds on 13 April 2009, 22:04:33 UTC
SHMEM_MAX_BYTES was derived from the maximum size of its triple-indirect
swap vector, forgetting to take the MAX_LFS_FILESIZE limit into account.
Never mind 256kB pages, even 8kB pages on 32-bit kernels allowed files to
grow slightly bigger than that supposed maximum.

Fix this by using the min of both (at build time not run time).  And it
happens that this calculation is good as far as 8MB pages on 32-bit or
16MB pages on 64-bit: though SHMSWP_MAX_INDEX gets truncated before that,
it's truncated to such large numbers that we don't need to care.

[akpm@linux-foundation.org: it needs pagemap.h]
[akpm@linux-foundation.org: fix sparc64 min() warnings]
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Yuri Tikhonov <yur@emcraft.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 61609d0
History
Tip revision: caefba1740d8016e6dfe8fda84f85bdcb8f8c85d authored by Hugh Dickins on 13 April 2009, 21:40:12 UTC
shmem: respect MAX_LFS_FILESIZE
Tip revision: caefba1
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
usr
virt
.gitignore -rw-r--r-- 867 bytes
.mailmap -rw-r--r-- 3.9 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 91.6 KB
Kbuild -rw-r--r-- 2.4 KB
MAINTAINERS -rw-r--r-- 142.0 KB
Makefile -rw-r--r-- 53.6 KB
README -rw-r--r-- 16.7 KB
REPORTING-BUGS -rw-r--r-- 3.1 KB

README

back to top