Right now we do this in ext4_do_update_inode
if (ei->i_disksize > 0x7fffffffULL) {
.....
.....
EXT4_SET_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_LARGE_FILE);
That is if i_disksize is greater that 2**31 -1 we set the flag
But in ext4_inode the size of i_size is 32 bits
__le32 i_size; /* Size in bytes */
That means it should be able to store ffffffffULL.
Why did we decided to enable the EXT4_FEATURE_RO_COMPAT_LARGE_FILE when we cross 2**31 -1 ?
NOTE: With EXT4_FEATURE_RO_COMPAT_LARGE_FILE we store the higer order 32 bits of i_size in i_dir_acl.
-aneesh