Re: Filesize limitation

teunis (teunis@mauve.computersupportcentre.com)
Wed, 5 Nov 1997 12:55:30 -0700 (MST)


On Wed, 5 Nov 1997, Chel van Gennip wrote:

> teunis@sigil.computersupportcentre.com wrote:
> >According to the thread I followed:
> > 1. ext2fs is happy with 64bit limits

I'm wrong about this : It's happy about 32bits worth of blocks... the
blocksize defines this any further I would guess.

> > 2. Linux/Alpha doesn't have a problem with this IIRC

Wrong here too *sigh*. At the moment anyways.

> > 3. The 64bit sysctls are still being built.....
> > (as a hint: they appeared in 2.1.60....)

and they need lots of work *sigh*... I just started reading the source...

> > 4. glibc-2.1 will be the first system to support them (already do)

This seems to be the case though :)

> >Now any and all of these could be wrong... But one clue: This thread
> >happened a month or three ago....
>
> I tried a simple program:
[program clipped]
>
> And I get these results:
> ...
> On Intel Linux version 2.0.31 (root@gennip2.vangennip.nl) (gcc version 2.7.2) #2

2.0.31 - does not support large files.. and afaik won't *sigh*.

> Next I tried on Alpha, even increased the loop count to 500 (5GB!):
> I can write and read a 5GB file:
> 497 pos= 4980000000, 4980000000
> 498 pos= 4990000000, 4990000000
> 499 pos= 5000000000, 5000000000
> -rw-r--r-- 1 root root 5000000008 Nov 5 14:20 tstfil
>
> Because the inode in a ext2 filesystem only has 32 bits for the
> length field, I unmounted the filesystem and remounted the filesystem.
> After this the file length is 4GB less:
> -rw-r--r-- 1 root root 705032712 Nov 5 14:20 tstfil

This is a bug in Alpha's ext2 code I would assume.

> Conclusion:
>
> 1. the ext2 filesystem can handle only 32 bits file-length.

32bit blocklength;
<x> bytes/block.
if block length = 1024 (common), can store 42bit lengths....
So it's not 64bit unless you use 64K blocks <deep sigh>....
[and as an aside: *ouch*]

on the flip side: stat() and friends use __off_t to define file sizes and
that is currently a "long int".... which is what "ls" calls.

> 2. Linux Alpha does not propperly test on this limit and wraps
> files?
> 3. Some parts of the kernel are able to support 64 bit file operations
> especially on Linux Alpha.

I suspect a bug in filling out the stat info. Anyone out there have any
ideas?

> So I think we still need a 64 bit (ext3?) filesystem.

Yep:

> I also think the AXP modification in fs/ext2/file.c from:
[clipped]

Agreed

Even though it may be for a custom filesystem (ext3?) and a custom set of
libraries (glibc-2.1+ :), 64bit filesystem support in the kernel is and
will be necessary. Userspace can catch up later.
'bout the only problem is how to handle the flavours *sigh*
I am now remembering the headaches.... Let's get back to this once the
current FS code is ready for it :)

G'day, eh? :)
- Teunis