Re: [PATCH 2/3] Add extended attributes to ext2/3

From: Andreas Dilger (
Date: Wed Oct 16 2002 - 12:05:39 EST

On Oct 16, 2002 12:16 -0400, Theodore Ts'o wrote:
> We do have one place where the 512 byte sector count is used, and
> that's in inode->i_blocks, which is stored as 512 byte sectors,
> regardless of the blocksize. *That's* due to st_blocks in the stat
> structure being returned in 512 byte sectors, and for no other good
> reason. As a result of this particular bit of history, ext2
> filesystems are limited to 2TB, even when using a 4k blocksize.
> Without this bit of "design history", we'd be able to support 16TB
> filesystems with 2.6's CONFIG_LBD support, without needing to going to
> a 64-bit block numbers. Making this change is actually pretty easy,
> and I may try to get that change to Linus before 2.6 closes.

Err, wouldn't that be a 2TB FILE limit, and not a FILESYSTEM limit?

Also, this limit only applies for allocated space within the file and
not the total size of the file (for sparse files). However, I don't
thing we have any checking in the kernel to ensure we don't overflow
2^32 allocated blocks for a single file (probably needs to be done in
ext*_alloc_block() or similar to ensure we have less than or equal to
"2^32 - (sb->blocksize >> 9)" blocks allocated to a file. I don't
know if we still have the old "limit total file size to 2TB" check
in there still.

Cheers, Andreas

Andreas Dilger

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Oct 23 2002 - 22:00:29 EST