0

I'm studying the Ext4 filesystem and am confused by the 128 byte inode size because it appears to conflict with the last metatdata value it stores which is supposed to be offset at byte 156.

In this documentation it states that inodes are 128 bytes in length. I called dumpe2fs on an unmounted /dev/sdb1. The dumpe2fs result corroborates the inode size is 128.

But I'm confused because this documentation delineates the metadata stored in the inode. For each entry of metadata there is a corresponding physical offset. The last entry is the project id. It's offset is in 0x9c (which is 156 as an integer).

It appears the metadata offsets exceed the allocated size of the inode. What am I misunderstanding here?

0

1 Answer 1

3

it states that inodes are 128 bytes in length

No. It states that [emphasis mine]:

[…] each inode had a disk record size of 128 bytes. Starting with ext4, it is possible to allocate a larger on-disk inode at format time for all inodes in the filesystem to provide space beyond the end of the original ext2 inode. The on-disk inode record size is recorded in the superblock as s_inode_size. The number of bytes actually used by struct ext4_inode beyond the original 128-byte ext2 inode is recorded in the i_extra_isize field for each inode […] By default, ext4 inode records are 256 bytes, and (as of August 2019) the inode structure is 160 bytes (i_extra_isize = 32).

Your doubt:

The last entry is the project id. Its offset is in 0x9c (which is 156 as an integer). It appears the metadata offsets exceed the allocated size of the inode.

The last entry starts at 156 and takes 4 bytes (__le32). It's within the default 160 bytes.

If dumpe2fs says the inode size is 128 for your filesystem, this means the filesystem uses the original 128-byte ext2 inode. There is no i_extra_isize (it would be at the offset 0x80, decimal 128) or anything specified beyond.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .