Re: statfs() / statvfs() syscall ballsup...

From: Linus Torvalds
Date: Thu Oct 09 2003 - 18:25:59 EST



On Thu, 9 Oct 2003, Andreas Dilger wrote:
>
> It would be nice if we could know in advance if we are returning values
> for sys_statfs() or sys_statfs64() (e.g. by sys_statfs64() calling an
> optional sb->s_op->statfs64() method if available) so we didn't have to
> do this munging. We can't just assume 64-bit results, or callers of
> sys_statfs() will get EOVERFLOW instead of slightly innacurate results.

This is something that sys_statfs() could do on its own. It's probably
always better to try to scale the block size up than to return EOVERFLOW.

(Some things can't be scaled up, of course, like f_ffree etc. But it
should be trivial to just do a "try to shift to make it fit" in the
vfs_statfs_native() function in fs/open.c).

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/