public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* statfs64 missing
@ 2002-10-16 14:06 Andi Kleen
  2002-10-16 14:16 ` Trond Myklebust
  0 siblings, 1 reply; 14+ messages in thread
From: Andi Kleen @ 2002-10-16 14:06 UTC (permalink / raw)
  To: linux-kernel, peter


I notice 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.

This problem already exists on 2.4. 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.
The only workaround currently is to increase wsize, but that has its
limits too.

Fixing it properly probably requires statfs64(). Any reason why this 
was not included in the sector_t patchkit ? 

-Andi

^ permalink raw reply	[flat|nested] 14+ messages in thread
* statfs64 missing
@ 2002-10-17 20:28 Steven French
  2002-10-17 21:55 ` Andreas Dilger
  0 siblings, 1 reply; 14+ messages in thread
From: Steven French @ 2002-10-17 20:28 UTC (permalink / raw)
  To: linux-kernel

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: sfrench@us.ibm.com



^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: statfs64 missing
@ 2002-10-17 21:27 Petr Vandrovec
  0 siblings, 0 replies; 14+ messages in thread
From: Petr Vandrovec @ 2002-10-17 21:27 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: Peter Chubb, Trond Myklebust, linux-kernel, ak

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
                                            vandrove@vc.cvut.cz
                                            

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2002-10-18  6:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-16 14:06 statfs64 missing Andi Kleen
2002-10-16 14:16 ` Trond Myklebust
     [not found]   ` <15789.64263.606518.921166@wombat.chubb.wattle.id.au>
2002-10-17  0:01     ` Andi Kleen
2002-10-17 19:41       ` Benjamin LaHaise
2002-10-18  0:19         ` [PATCH] statfs64 no longer missing Peter Chubb
2002-10-18  0:26           ` Benjamin LaHaise
2002-10-18  2:31           ` Andi Kleen
2002-10-18  3:27             ` Peter Chubb
2002-10-18  6:17           ` Andreas Dilger
2002-10-18  6:31             ` Andi Kleen
2002-10-18  6:41               ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2002-10-17 20:28 statfs64 missing Steven French
2002-10-17 21:55 ` Andreas Dilger
2002-10-17 21:27 Petr Vandrovec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox