files > 2GB

Khimenko Victor khim en sch57.msk.ru
Mar Ene 25 10:44:17 CST 2000


In <86k505$1v4$1 en enterprise.cistron.net> Miquel van Smoorenburg (miquels en cistron.nl) wrote:
> In article <cistron.Pine.LNX.4.10.10001251153450.7863-100000 en ps.cus.umist.ac.uk>,
> Riley Williams  <rhw en MemAlpha.CX> wrote:
>> Q. What should the kernel do when, in the middle of executing a
>>    function that returns a 32-bit off_t value, it finds itself
>>    referring to a file whose length is too large to be stored in
>>    such a value?

> You can only open files >= 2GB if you pass the O_LARGEFILE flag
> to open(2). Otherwise open() will simply fail. As legacy apps do
> not set O_LARGEFILE, there is no problem.

Are you sure ??? File can grow while it's opened :-)

> If you do open a file >= 2GB with O_LARGEFILE but then use stat()
> instead of stat64(), the results are probably not defined. And
> the kernel may choose to exec /usr/local/bin/nethack at that point.

What if you opened file >= 2GiB without O_LARGFILE but when you are
calling stat() or lseek() when file grown to size > 2GiB ?

P.S. Perhaps some ext2fs flag can be added to handle this (that is: "big file"
can not be opened without O_LARGEFLAG while "normal file" can not be > 2GiB and
you can not set that flag when file is opened  by some process) - you do not
need lots of such files after all :-) But it look ugly like a hell...





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



Más información sobre la lista de distribución Ayuda