From b09a4b0c906db2e520296b31855b7947e889f514 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 24 Oct 2000 21:16:09 +0000 Subject: [PATCH] ChangeLog, pass1.c: pass1.c (e2fsck_pass1): Don't check the i_mode field for the journal inode, if it is in use. --- e2fsck/ChangeLog | 5 +++++ e2fsck/pass1.c | 25 +++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 049aadc..51b9e44 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,8 @@ +2000-10-24 + + * pass1.c (e2fsck_pass1): Don't check the i_mode field for the + journal inode, if it is in use. + 2000-09-12 * extend.c: diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index d780b96..e447044 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -374,6 +374,7 @@ void e2fsck_pass1(e2fsck_t ctx) e2fsck_write_inode(ctx, ino, &inode, "pass1"); } + } /* * If dtime is set, offer to clear it. mke2fs @@ -394,13 +395,25 @@ void e2fsck_pass1(e2fsck_t ctx) } if ((ino != EXT2_ROOT_INO) && (ino < EXT2_FIRST_INODE(fs->super))) { + int problem = 0; + ext2fs_mark_inode_bitmap(ctx->inode_used_map, ino); - if (((ino == EXT2_BOOT_LOADER_INO) && - LINUX_S_ISDIR(inode.i_mode)) || - ((ino != EXT2_BOOT_LOADER_INO) && - (inode.i_mode != 0))) { - if (fix_problem(ctx, - PR_1_RESERVED_BAD_MODE, &pctx)) { + switch (ino) { + case EXT2_BOOT_LOADER_INO: + if (LINUX_S_ISDIR(inode.i_mode)) + problem = PR_1_RESERVED_BAD_MODE; + break; + case EXT2_JOURNAL_INO: + if (fs->super->s_journal_inum == + EXT2_JOURNAL_INO) + break; + default: + if (inode.i_mode != 0) + problem = PR_1_RESERVED_BAD_MODE; + break; + } + if (problem) { + if (fix_problem(ctx, problem, &pctx)) { inode.i_mode = 0; e2fsck_write_inode(ctx, ino, &inode, "pass1"); -- 1.8.3.1