Whamcloud - gitweb
resize2fs: attempt to keep the # of inodes valid by removing the last bg
authorTheodore Ts'o <tytso@mit.edu>
Tue, 14 Sep 2021 12:41:33 +0000 (08:41 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 30 Sep 2021 17:38:50 +0000 (13:38 -0400)
commit623985ed7dd58b0996a057ee55c1c7b23b10c641
tree4f73c6fb9fb77f158ea156bcd0fb50d900ec32e2
parentda33289073de254ab4bacb80b1b83cf9d27c76ea
resize2fs: attempt to keep the # of inodes valid by removing the last bg

If a the 10GB file system (with the default inode ratio size of 16k)
is resized to 64TB, the number of inodes will become 2**32 --- one
above the maximum allowed number of inodes of 2**32-1.  In
adjust_fs_info(), we already try drop the last block group if there
isn't sufficient space in the last block group to support the metadata
for that block group.  So if dropping the last block group allows the
number of inodes to valid, we should try that as well.  In some cases
this will mean resizing a file system to 64TB will result in it be
resized to a size of 64TB - 128MB, which is close enough for
government work.

Addresses-Google-Bug: 199105099
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Leah Rumancik <leah.rumancik@gmail.com>
resize/resize2fs.c