resize2fs: enforce the 16TB limit on 32-bit file systems correctly

The 16TB limit must be enforced regardless of whether the new size is
specified on the command line or implied by the size of the device,
but only if the file system does not support 64-bit block sizes, or
the kernel does not advertise support of meta_bg resizing.

Previously we were unconditionally enforcing it when it was implied by
the device size, but not if the new size was specified on the command
line.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
resize2fs: fix overhead calculation for meta_bg file systems

The file system overhead calculation in calculate_minimum_resize_size
was incorrect meta_bg file systems.  This caused the minimum size to
underflow for very large file systems, which threw resize2fs into a
loop generally lasted longer than the user's patience.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
resize2fs: allow meta_bg/64-bit file systems to be online resized

Resize2fs can't handle resizing flex_bg file systems that do not have
the resize inode, but when the kernel adds support for resizing using
the meta_bg layout, we should allow it be able to resize the file
system.

So move the flex_bg/resize_inode check to the just before we start
doing the off-line resize, instead of doing it earlier where it would
prohibit these file systems for both on-line and off-line resizes.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
resize2fs: enforce restrictions if the kernel doesn't do meta_bg resizing

Enhance the online resizing code to be more nuanced about resizing
restrictions.  If the kernel supports meta_bg resizing, then we can
skip all of the restrictions.  If the kernel does not support meta_bg
resizing, check more carefully to make sure there are enough reserved
gdt blocks, so that the user gets a clearer error message.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
resize2fs: grow uninit_bg file systems more efficiently

If the uninit_bg feature is enabled and the kernel supports
lazy_itable_init, skip zeroing the inode table so that the resize
operation can go much more quickly.  Also set the itable_unused fields
so that the first e2fsck after the resize will run faster.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
mke2fs: throttle progress updates to once a second

With lazy itable initialization, the progress updates for writing the
inode table happens so quickly that on a serial console, the time to
write the progress updates can be the bottleneck.  Fix this by only
updating the progress indicator once a second.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
mke2fs: disable progress reporting in mke2fs.conf for regression tests

Add a configuration knob so the regression tests can disable progress
reporting.  This fixes a potential lack of predictability since the
progress reports are now time based (once a second) which is
problematic for regression tests which are comparing the expected
output of mke2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
tests: kill debugfs on interrupted MMP test

If the f_mmp test is interrupted during its test run, then it can
leave debugfs busy-looping in the background.  Since f_mmp is a
relatively long-running test, and is likely to be running during
a parallel test run, this can happen fairly often.

Set a signal trap for the f_mmp test script being killed, so that
the background debugfs command will always be killed by the test.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>