]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix growing of tiny filesystems
authorJan Kara <jack@suse.cz>
Sun, 3 May 2015 03:58:32 +0000 (23:58 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 3 May 2015 03:58:32 +0000 (23:58 -0400)
commita604996dcd6a2537f5526f511bad54fa31496ed5
tree42031363a2328d0c0c3591929569fd699c7ee7e6
parentf43807937e36e73f250139ee631b6507c81f1e26
ext4: fix growing of tiny filesystems

The estimate of necessary transaction credits in ext4_flex_group_add()
is too pessimistic. It reserves credit for sb, resize inode, and resize
inode dindirect block for each group added in a flex group although they
are always the same block and thus it is enough to account them only
once. Also the number of modified GDT block is overestimated since we
fit EXT4_DESC_PER_BLOCK(sb) descriptors in one block.

Make the estimation more precise. That reduces number of requested
credits enough that we can grow 20 MB filesystem (which has 1 MB
journal, 79 reserved GDT blocks, and flex group size 16 by default).

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
fs/ext4/resize.c