]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
resize2fs: fix sanity check in reserve_sparse_super2_last_group()
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 12 May 2014 03:33:08 +0000 (23:33 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 13 May 2014 14:13:40 +0000 (10:13 -0400)
In reserve_sparse_super2_last_group, the old_desc check should only be
performed if ext2fs_super_and_bgd_loc2() gave us a location -- a
return value of 0 means that there is no old-style GDT block.

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

index c672cdbe0c8543c9442aa03250a9dda367cadc4d..e528f6274014053a8f704fecff3a3ad4075f3475 100644 (file)
@@ -2047,7 +2047,7 @@ static errcode_t reserve_sparse_super2_last_group(ext2_resize_t rfs,
                      stderr);
                exit(1);
        }
-       if (old_desc != sb+1) {
+       if (old_desc && old_desc != sb+1) {
                fputs(_("Should never happen!  Unexpected old_desc in "
                        "super_sparse bg?\n"),
                      stderr);