Previously we were always retrying the ext2fs_open2() call with the
EXT2_FLAG_IGNORE_SB_ERRORS flag. It only makes sense to do this if
the superblock is reported as corrupt. Otherwise, it's a waste of
time, and results in printing an extra set of error messages to annoy
the user.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* so that we are able to recover from more errors
* (e.g. some tool messing up some value in the sb).
*/
- if (!(flags & EXT2_FLAG_IGNORE_SB_ERRORS)) {
+ if ((retval == EXT2_ET_CORRUPT_SUPERBLOCK) &&
+ !(flags & EXT2_FLAG_IGNORE_SB_ERRORS)) {
if (fs)
ext2fs_close_free(&fs);
log_out(ctx, _("%s: Trying to load superblock "
ext2fs_open2: Bad magic number in super-block
../e2fsck/e2fsck: Superblock invalid, trying backup blocks...
../e2fsck/e2fsck: Bad magic number in super-block while trying to open test.img
-../e2fsck/e2fsck: Trying to load superblock despite errors...
-ext2fs_open2: Bad magic number in super-block
-../e2fsck/e2fsck: Superblock invalid, trying backup blocks...
-../e2fsck/e2fsck: Bad magic number in super-block while trying to open test.img
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
e2fsck external journal
../e2fsck/e2fsck: Filesystem has unsupported feature(s) while trying to open test.img
-../e2fsck/e2fsck: Trying to load superblock despite errors...
-../e2fsck/e2fsck: Filesystem has unsupported feature(s) while trying to open test.img
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4