Whamcloud - gitweb
resize2fs: move bitmaps if shrinking would orphan them
authorEric Sandeen <sandeen@redhat.com>
Wed, 19 Jun 2013 01:37:05 +0000 (20:37 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 21 Jun 2013 02:47:16 +0000 (22:47 -0400)
commit80391dcd2ec853981a11e1178ff7a19598a4e81c
tree07625c26a53a9ecce0f5b89e3a9e12dd4ca2bd70
parentb49d67ddd8af9568bd5eee319af0479f042db4fd
resize2fs: move bitmaps if shrinking would orphan them

It is possible to have a flex_bg filesystem with block groups
which have inode & block bitmaps at some point well past the
start of the group.

If an offline shrink puts the new size somewhere between
the start of the block group and the (old) location of
the bitmaps, they can be left beyond the end of the filesystem,
i.e. result in fs corruption.

Check each remaining block group for whether its bitmaps
are beyond the end of the new filesystem, and reallocate
them in a new location if needed.

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