I've formatted a new filesystem with and without extents
feature just to understand how this feature works. However, when I look at the inode field i_flags
I see that this field always has zero value (for "used" inodes 2, 7 and 11).
Documentation (from Kernel.org) about extents says, that this flag should have 0x80000 bit set for inodes which use extents – but it looks like it's not accurate.
Can I have inodes with and without extents in the same filesystem? Should I rely on the i_flags
to determine the way, how the i_block
field is used? Or it is just one filesystem-wide flag in the superblock which dictates extents usage for all inodes?
Best Answer
The
extents
flag is stored for each inode, so it is possible to upgrade an ext3 filesystem without extents to ext4, and then enable theextents
feature in the superblock and new inodes would be created withextents
enabled. You should definitely check the per-inode flag to decide howi_blocks
is being used for each file.