From: Michael Marineau Date: Tue, 5 Feb 2008 06:28:48 +0000 (-0800) Subject: tmpfs: fix mounts when size is less than the page size X-Git-Tag: v2.6.25-rc1~969 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=818db35992c249dc32c1d86daf7d533fb0952f5d;p=pandora-kernel.git tmpfs: fix mounts when size is less than the page size When tmpfs is mounted with a size less than one page, the number of blocks is set to 0 which makes the tmpfs mount unlimited. This can lead to a quick and surprising death if someone typos a tmpfs mount command and writes too much. tmpfs can still be mounted as unlimited if size or nr_blocks is exactly 0, as Documentation/filesystems/tmpfs.txt says. Hugh: do this by rounding size up instead of down in all cases: which slightly expands other odd-sized tmpfs mounts, but in a consistent way. Signed-off-by: Michael Marineau Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed