Re: File Size question

Jan Kara (jack@atrey.karlin.mff.cuni.cz)
Tue, 24 Nov 1998 13:40:55 +0100


> purposes). However, the largest size file I can create is 1073741824
> bytes. I have explored the kernel source files and have found 2 source
> files where a "file too big" message can crop up: file.c and inode.c under
> /usr/src/linux/fs/ext2. After some experimenting I found that code within
> the inode.c was limiting the size a file could be. When I bypassed this
> code, I was able to make a 1.5 gig. file.
>
> Needless to say, I have a feeling this is a dangerous thing to do. My
> question is, is there any way around the 1.07 gigabyte limitation? Any
> advice someone might have would be greatly appreciated.
>
> Here's the exact code within inode.c that gives the file-too-big error
> when attempting to create a new file bigger than 1.07 gig:
>
> if (!create || new_block >=
> (current->rlim[RLIMIT_FSIZE].rlim_cur >>
> EXT2_BLOCK_SIZE_BITS(inode->i_sb))) {
If this is the place which returns EFBIG then you have probably set file size limit
(look for command ulimit).
> brelse (bh);
> *err = -EFBIG;
> return NULL;
> }
>
But soon you will hit another limit - 2 GB (if you have 32-bit system). More about
this problem can be found in the archive of this mailing-list or prabably in FAQ.

Goodbye. Honza.

-
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/