2

In the Linux kernel source, the block numbers in an on-disk inode struct are 32-bit. Why? Surely Linux can support more than 2^32 blocks...

extremeaxe5
  • 1,183

1 Answers1

4

The interpretation of the array inode.i_block is different in Ext4 compared to previous on-disk filesystem formats. In Ext4, when the inode has the EXT4_EXTENT_FL set in i_flags this array stores the root of the extent tree and up to four extent descriptors (struct ext4_extent or struct ext4_extent_idx). You will notice that in the extent descriptor there are 48 bits for the block address. For older on-disk formats, e.g. Ext3, the maximum number of block does indeed fit in 32 bits.

See Ext4 data structures and algorithms, section 4.2 The Contents of inode.i_block.

LustreOne
  • 1,774
AlexP
  • 10,455