diff options
author | Jon Tollefson <kniht@linux.vnet.ibm.com> | 2008-07-24 04:27:55 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 17:47:19 (GMT) |
commit | f4a67cceee4a6f5ed38011a698c9e34747270ae5 (patch) | |
tree | 6da3eed51a938e1680a6212c56f9383bcf5670e0 /fs/open.c | |
parent | 91224346aa8c1cdaa660300a98e0b074a3a95030 (diff) | |
download | linux-fsl-qoriq-f4a67cceee4a6f5ed38011a698c9e34747270ae5.tar.xz |
fs: check for statfs overflow
Adds a check for an overflow in the filesystem size so if someone is
checking with statfs() on a 16G blocksize hugetlbfs in a 32bit binary that
it will report back EOVERFLOW instead of a size of 0.
Acked-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Jon Tollefson <kniht@linux.vnet.ibm.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -64,7 +64,8 @@ static int vfs_statfs_native(struct dentry *dentry, struct statfs *buf) memcpy(buf, &st, sizeof(st)); else { if (sizeof buf->f_blocks == 4) { - if ((st.f_blocks | st.f_bfree | st.f_bavail) & + if ((st.f_blocks | st.f_bfree | st.f_bavail | + st.f_bsize | st.f_frsize) & 0xffffffff00000000ULL) return -EOVERFLOW; /* |