Re: large file support? (fwd)

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Sun, 17 Aug 1997 18:18:30 +0200 (MET DST)


Alan Cox wrote:
>
> > functions/syscalls if the file is smaller than 2GB. If the descriptor
> > is used with a syscall for small files and the file is larger than 2GB
> > the operation should fail and return EOVERFLOW.
> >
> > I've talked a bit with Alan about this so he might be a good person to
> > talk to before starting this (especially since he's sceptical). I can
> > only say that once the kernel has this stuff the libc will follow a
> > few days later.
>
> There are several reasons I'm sceptical. Firstly a 64bit aware bash opens
> a file redirection to a 32bit app which then blows up mysteriously...
>
> The "file smaller than 2Gb" is unenforcable because other processors
> may also be altering an object, this object might also change remotely
> on a networked fs.
>
> Obviously certain operations should fail - an lseek(), any attempt to
> go past 2^31 bits on an fs that isnt 64bit aware (again this is hard
> as two people may be writing). An mmap() of a small chunk that overlaps
> 2^32 is possibly a nasty one to handle but its just a "catch all cases"
> thing.
>
> The big problem is the EOVERFLOW blowing up apps it doesnt need to
>

Can someone enlighten me why blowing up half-legal operations through a
32bit interface are supposed to fail?

read/write
lseek relative-current-position

are operations that I'd want to succeed, even if a file is larger than
2Gb.

lseek-absolute (or eof-relative)

is a case where you COULD simply do "the best you can", but part of the
file is inaccessable for a 32bit application. You could say: "to prevent
odd bugs we disallow this".

Appending to a large file (as Alan says) should always be possible, even
for 64bit unaware programs. seeking in the "small" part just created
should also be possible.

When browsing a large disk I sometimes use:

(seek 0x110000000 ; dd bs=1k count=1 | hd) < /dev/sda

to view the kilobyte at 4G+256M . My "dd" is currently 64 bit unaware,
that "seek" program that I wrote is 64bit aware.... This mixing of
32 bit and 64 bit applications makes the transition smooth, and should
continue to work.

(hd is my hex dump program).

Roger.