If the disk is too big to be queried by the old statfs, return -EOVERFLOW rather than truncated results. fs/open.c | 5 +++++ 1 files changed, 5 insertions(+) diff -puN fs/open.c~statfs-overflow-fix fs/open.c --- 25/fs/open.c~statfs-overflow-fix 2003-06-03 18:01:07.000000000 -0700 +++ 25-akpm/fs/open.c 2003-06-03 19:36:12.000000000 -0700 @@ -52,6 +52,11 @@ static int vfs_statfs_native(struct supe if (sizeof(*buf) == sizeof(st)) memcpy(buf, &st, sizeof(st)); else { +#if BITS_PER_LONG == 32 + if ((buf->f_blocks|buf->f_files|buf->f_ffree) & + 0xffffffff00000000ULL) + return -EOVERFLOW; +#endif buf->f_type = st.f_type; buf->f_bsize = st.f_bsize; buf->f_blocks = st.f_blocks; _