]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: suppress spurious "checksum errors" message for unrelated failures
authorTheodore Ts'o <tytso@mit.edu>
Mon, 25 Jun 2018 01:21:49 +0000 (21:21 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 25 Jun 2018 01:21:49 +0000 (21:21 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c

index 2bf6a30ce067827db53081b5a0b15bc386453f9b..ecca8108272046608f19c4c7e11ad2d1f33e989c 100644 (file)
@@ -172,7 +172,8 @@ static void open_filesystem(char *device, int open_flags, blk64_t superblock,
 try_open_again:
        retval = ext2fs_open(device, open_flags, superblock, blocksize,
                             io_ptr, &current_fs);
-       if (retval && !(open_flags & EXT2_FLAG_IGNORE_CSUM_ERRORS)) {
+       if (retval && (retval == EXT2_ET_SB_CSUM_INVALID) &&
+           !(open_flags & EXT2_FLAG_IGNORE_CSUM_ERRORS)) {
                open_flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
                printf("Checksum errors in superblock!  Retrying...\n");
                goto try_open_again;