Whamcloud - gitweb
resize2fs: use old_fs to detect per-bg metadata blocks to free
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 15 Dec 2014 02:09:29 +0000 (21:09 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 15 Dec 2014 02:09:29 +0000 (21:09 -0500)
commit8e98899b2ffc43f151a21afb5bad85e80d6b6d85
tree631c5f3203d013dfa496f5d9015c72106adcc76a
parent0698ecc1e2ae4723f331ada46074a2d4e826be31
resize2fs: use old_fs to detect per-bg metadata blocks to free

When shrinking a filesystem, resize2fs wants to free per-bg metadata
blocks that are no longer needed.  This behavior is gated on whether
there's a superblock in the group as told by new_fs.  The check really
should be against old_fs, since we're effectively freeing blocks out
of old_fs in the transition to new_fs, but prior to sparse_super2 this
didn't matter since superblocks didn't move, so it didn't matter.

Under sparse_super2, however, there's a superblock in the last group,
so now we need to change the test to use old_fs as it should.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
resize/resize2fs.c