Whamcloud - gitweb
resize2fs: don't exit if shrinking sparse_super2 fs to one bg
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 14 Dec 2014 03:06:15 +0000 (22:06 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 14 Dec 2014 03:06:15 +0000 (22:06 -0500)
If we're shrinking a sparse_super2 filesystem to a single block group,
the superblock will be in block 0.  This is perfectly valid (for block
group 0 with a blocksize > 1024) so don't exit.

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

index 8c5db86..4861719 100644 (file)
@@ -2126,7 +2126,7 @@ static errcode_t reserve_sparse_super2_last_group(ext2_resize_t rfs,
        if (retval)
                return retval;
 
-       if (!sb) {
+       if (last_bg && !sb) {
                fputs(_("Should never happen!  No sb in last super_sparse bg?\n"),
                      stderr);
                exit(1);