2007-05-02 09:13:37

by Kalpak Shah

[permalink] [raw]
Subject: [PATCH] e2fsprogs: Expand inode size

Hi,

With the addition of the *time_extra fields and i_version_hi field
beyond the EXT2_GOOD_OLD_INODE_SIZE, old filesystems need to have their
inodes expanded to avail these features. Obviously expansion of the
inode is possible only if the inode size > 128.

This patch adds a "-E expand_extra_isize" feature which makes sure that
_every_ used inode has i_extra_isize >= s_min_extra_isize if
s_min_extra_isize is set. Else it makes sure that i_extra_isize of every
inode is equal to sizeof(ext2_inode_large) - 128.

If no in-inode EAs are present then i_extra_isize can be easily
increased. If any in-inode EAs are present then they are moved to an
external EA block to create space for expansion in the inode.

But if enough space is not available for moving the in-inode EAs to the
external EA block then some EA(s) would have to be deleted. In this
case, e2fsck will display each EA (starting from user. and going on to
more important ones) asking the user to delete one or more EA(s) to get
the required space for expansion. e2fsck will abort if this condition
arrives and it is being run in -y or -p mode. If the user refuses to
delete EAs, then the EXTRA_ISIZE feature would be disabled. This
guarantees us that at the end of the e2fsck run, all inodes will be
expanded or EXTRA_ISIZE won't be set.

Any comments or reviews are welcome.

Signed-off-by: Andreas Dilger <[email protected]>
Signed-off-by: Kalpak Shah <[email protected]>

Thanks,
Kalpak.


Attachments:
e2fsprogs-expand-extra-isize.patch (46.79 kB)