]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: allow read-write opening in catastrophic mode
authorJan Kara <jack@suse.cz>
Tue, 19 Jun 2018 15:15:53 +0000 (11:15 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 19 Jun 2018 15:27:51 +0000 (11:27 -0400)
Allow filesystem to be open read-write in catastrophic mode so that one
can fixup e.g. superblock breakage. The CHECK_FS_BITMAPS flag to
common_args_process() still guards us from doing operations on bitmaps
which we don't load in this mode.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c

index cbcfa24c0bebfd3af589e127e0593fe1d0adf152..a4f3370ba169dcb382d73b4c6b0fa05e696164c1 100644 (file)
@@ -159,11 +159,6 @@ static void open_filesystem(char *device, int open_flags, blk64_t superblock,
                }
        }
 
-       if (catastrophic && (open_flags & EXT2_FLAG_RW)) {
-               com_err(device, 0,
-                       "opening read-only because of catastrophic mode");
-               open_flags &= ~EXT2_FLAG_RW;
-       }
        if (catastrophic)
                open_flags |= EXT2_FLAG_SKIP_MMP;