Re: Reaching user disk quota limit creates a 2**32-1 byte file

From: Stephen C. Tweedie (sct@redhat.com)
Date: Tue Mar 28 2000 - 22:58:11 EST


Him

On Tue, Mar 28, 2000 at 02:50:31PM +0100, Nick Burrett wrote:
>
> Hello,
>
> I've been experiencing a filesystem error using various Linux kernels
> since 2.0.36.

It's fine in current 2.2 kernels.

> This bug report relates to a test I have made on kernel
> 2.3.99-pre3. The problem manifests itself when an attempt is made to
> extend a file but the diskquota check blocks the attempt, resulting in
> a 4294967295 byte file.

Not surprising, since what perl is doing is trying to set the file
size to 4294967295!

> truncate (LOG, tell (LOG));

What is happening is that after the write() returns an EDQUOT error,
perl's tell function is returning an error (-1), which is being
passet to ftrunacate(). If you are seeing the size set to this odd
value it is because the kernel is treating it as an unsigned int
and casting it to the large value 4294967295. That's actually a
legal file size in 2.3, as we now have large file support in the
kernel.

So it's basically a bug in your program, as you are not checking for
whether tell() returns an error code or not. However, there is
probably a kernel misbehaviour being reported here, since the kernel
should not allow a file to be ftruncate()d to a size larger than
2GB if the file wasn't opened with the appropriate large file
flags. I'll check that.

--Stephen

-
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 : Fri Mar 31 2000 - 21:00:23 EST