Whamcloud - gitweb
resize2fs: don't attempt to calculate minimum size on fs with errors
authorEric Sandeen <sandeen@redhat.com>
Mon, 9 Jun 2014 13:52:19 +0000 (09:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 9 Jun 2014 13:52:22 +0000 (09:52 -0400)
commit7d7a8fe4ea4d9162977a1a6b32c4737d9ca9dd1f
treee31bbcac2170e61c88c5938f69bf6394b1da384d
parenta0edefe5fbfd10826b744bb5b6965ea2862b07ac
resize2fs: don't attempt to calculate minimum size on fs with errors

My old patch:

resize2fs: don't print minimum size if fs is not clean

almost did this, but it still calculated the size; it just didn't print
it.  Which is a bit silly.

Jes had a pretty badly corrupted image which made the minimum size
calculation go off into the weeds.  It was corrupted, and also marked
as having an error.

We'll eventually bail out for an unmounted filesystem if it's marked
as being in an error state anyway; just move that test & bail-out
to a much earlier point, and remove the now-duplicate one under the
print_min_size block.

This will catch & block all resize operations on an offline filesystem
with errors, in one central place.

Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
resize/main.c