]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
resize2fs: adjust new size of the file system to allow a successful resize
authorTheodore Ts'o <tytso@mit.edu>
Tue, 14 Sep 2021 12:56:46 +0000 (08:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 30 Sep 2021 17:38:56 +0000 (13:38 -0400)
commit4ea80d031c7eb8e90aaebe1c0c50a3a1230995ed
tree5ba593e9592a31679c2cfd08b990a2eff82ccac3
parent623985ed7dd58b0996a057ee55c1c7b23b10c641
resize2fs: adjust new size of the file system to allow a successful resize

The previous commit in this series (commit 50088b1996cc: "resize2fs:
attempt to keep the # of inodes valid by removing the last bg") allows
a successful off-line resize of a file system with the default 16k
inode ratio to be grown to support a 64TB storage device by dropping
the last block group so the number of inodes is just below the maximum
2**32-1 number of inodes.

However, this is not a complete solution, for two reasons.  First,
this adjustment happens after resize2fs has started potentially making
changes to the file system in the off-line (unmounted) case, which
means resize2fs will do a lot of unnecessary work.  Secondly, in the
on-line resize case, passing the original requested size to the kernel
causes the kernel fail the online resize request.

So teach resize2fs to adjust the new size of the file system much
earlier, which avoids both problems.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Leah Rumancik <leah.rumancik@gmail.com>
resize/main.c
resize/resize2fs.c
resize/resize2fs.h
tests/r_move_itable/expect