2002-10-17 20:23:49

by Steven French

[permalink] [raw]
Subject: statfs64 missing

Interesting question for other distributed filesystems as well, not just
NFS.
There are two calls sent in the CIFS case to get this info. One requesting
"FILE_SYSTEM_ATTRIBUTE_INFO" to get f_namelen (which presumably does not
vary so does not need to be requeried every statfs and the field length is
big enough
as is) and "FILE_SYSTEM_INFO" which returns 64 bit quantities for Total and
Free
"Allocation Units" and then a 32 bit quantity for Sectors per Allocation
Unit
and a 32 bit quantity for bytes for sector. With big SAN based arrays of
disks
running under some of the high end CIFS based server appliances from
EMC, NetApp etc. it would not be surprising to me to see an overflow
problem for
the 32 bit statfs fields today (mapping from the values in the
FILE_SYSTEM_INFO
returned by the server to statfs struct on i386 clients) unless the local
fs lies
about the block size. For the cifs vfs adding a statfs64 func would
certainly
be technically feasible from the protocol's perspective and pretty easy.

> 2.5 has 64bit sector_t but no statfs64() system call for
>32bit architectures. How is df supposed to report it? statfs
> uses 32bit block counts.
>
>The currently limit depends on the block size, the bigger your
>block size the more bytes it can report.
>
> You can actually access NFS servers which have more
> than 2TB of disk space. NFS uses the local write size
> as block size. When you are lucky then 0xfffffffff*wsize
> is bigger than what your NFS server reports. If not
> you get wrong results.
>
> -Andi


Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: [email protected]



2002-10-17 21:22:00

by Petr Vandrovec

[permalink] [raw]
Subject: Re: statfs64 missing

On 17 Oct 02 at 15:41, Benjamin LaHaise wrote:
> On Thu, Oct 17, 2002 at 02:01:11AM +0200, Andi Kleen wrote:
> ...
> > So it boils down to if the new fields are important enough to justify
> > the pain they cause on 64bit.
> >
> > (I ran into a similar issue with my nanosecond stat patchkit -
> > alpha stat is 64bit clean, but doesn't have the padding for ns fields
> > added used in later ports)
>
> If any new stat() type syscalls are added, make sure that a length parameter
> of the structure gets passed in from userland, as that way we will be able
> to extend the available information without introducing yet another syscall
> on every arch (this has happened enough times now that we should try to get
> it right).

And if VFS could get access to dentry which was used for statfs,
I (and ncpfs) will be very happy, as then I can report space available
for user after applying directory restrictions just through normal
statfs call, instead of using own special call.

I understand that then it becomes more inode than superblock operation,
and that it is too late for 2.6...
Thanks,
Petr Vandrovec
[email protected]

2002-10-17 21:51:30

by Andreas Dilger

[permalink] [raw]
Subject: Re: statfs64 missing

On Oct 17, 2002 15:28 -0500, Steven French wrote:
> With big SAN based arrays of disks running under some of the high end
> CIFS based server appliances from EMC, NetApp etc. it would not be
> surprising to me to see an overflow problem for the 32 bit statfs fields
> today (mapping from the values in the FILE_SYSTEM_INFO returned by the
> server to statfs struct on i386 clients) unless the local fs lies
> about the block size. For the cifs vfs adding a statfs64 func would
> certainly be technically feasible from the protocol's perspective and
> pretty easy.

Yes, I hit this problem a month or two ago with Lustre - the 90TB
filesystem we are testing on wrapped and I thought it was a problem
in our code until I did some more digging. However, lying about
the blocksize isn't a big loss, since we prefer 64kB vector page I/O
over the network anyways for performance reasons, even though the
backing stores actually use 4kB blocksize.

Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/