Re: files > 2GB

From: Khimenko Victor (khim@sch57.msk.ru)
Date: Tue Jan 25 2000 - 07:58:25 EST


In <86k505$1v4$1@enterprise.cistron.net> Miquel van Smoorenburg (miquels@cistron.nl) wrote:
> In article <cistron.Pine.LNX.4.10.10001251153450.7863-100000@ps.cus.umist.ac.uk>,
> Riley Williams <rhw@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@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:14 EST