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

From: Theodore Ts'o (
Date: Wed Oct 16 2002 - 11:16:20 EST

On Wed, Oct 16, 2002 at 09:38:02AM +0000, Henning P. Schmiedehausen wrote:
> writes:
> >+ int ea_blocks = EXT3_I(inode)->i_file_acl ?
> >+ (inode->i_sb->s_blocksize >> 9) : 0;
> Sometimes I wonder if we shouldn't have the block size (512) and the
> bit shift (9) as defines somewhere and gradually shift away from hard
> coded values...
> If we ever decide to change the block size of ext2/ext3, we're in for
> a "looking for nines"... :-)

We already have different block sizes for ext2/3; we support 1k, 2k,
and 4k block sizes. The bit shift is only there because the
superblock stores the blocksize shifted by 9 for "historical reasons".
(i.e., I probably wouldn't have bothered with it, but Remy Card did it
that way, and it doesn't hurt, so make everyone suffer with an
incompatible format change?)

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.

                                                - Ted
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:28 EST