Struct ext2_inode {
...
_ U32 I _size;/* file size in bytes */
...
_ U32 I _block [ext2_n_blocks];/* pointer array pointing to data blocks */
_ Le32 I _dir_acl;/* Directory Access Control List */
...
};
I have just read chapter 18th of "a deep understanding of Linux kernel", which describes this issue:
Leave the 32-bit I _size field to limit the file size to 4 GB. In fact, the maximum bit of the I _size field is not used. Therefore, the maximum length of the file is 2 GB.
However, the ext2 file system contains a "dirty trick" that allows 64-bit architectures like amd opteron and IBM PowerPC G5 to use large files.
In essence, the I _dir_acl field of the index node (not used in common files) indicates the 32-bit expansion of the I _size field. Therefore, the file size is stored as a 64-bit integer in
Index node. Ext2 file system 64-bit and 32-bit versions are compatible to some extent, because the ext2 file system created on the 64-bit architecture can be installed on 32-bit
Architecture, and vice versa. However, large files cannot be accessed in the 32-bit file architecture unless the file is opened with the o_largefile flag.