diff mbox series

[07/10] debugfs: Allow read-write opening in catastrophic mode

Message ID 20180612095328.5215-8-jack@suse.cz
State Accepted, archived
Headers show
Series e2fsprogs: Handle s_inodes_count overflow better | expand

Commit Message

Jan Kara June 12, 2018, 9:53 a.m. UTC
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>
---
 debugfs/debugfs.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Theodore Ts'o June 19, 2018, 3:16 p.m. UTC | #1
On Tue, Jun 12, 2018 at 11:53:25AM +0200, Jan Kara wrote:
> 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>

Applied, thanks.

					- Ted
diff mbox series

Patch

diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 905c8cdc6733..b1842443aa8e 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -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;