Whamcloud - gitweb
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 2bf6a30..ecca810 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;