Whamcloud - gitweb
ChangeLog, pass1.c:
authorTheodore Ts'o <tytso@mit.edu>
Tue, 24 Oct 2000 21:16:09 +0000 (21:16 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 24 Oct 2000 21:16:09 +0000 (21:16 +0000)
  pass1.c (e2fsck_pass1): Don't check the i_mode field for the journal
   inode, if it is in use.

e2fsck/ChangeLog
e2fsck/pass1.c

index 049aadc..51b9e44 100644 (file)
@@ -1,3 +1,8 @@
+2000-10-24    <tytso@snap.thunk.org>
+
+       * pass1.c (e2fsck_pass1): Don't check the i_mode field for the
+               journal inode, if it is in use.
+
 2000-09-12    <tytso@valinux.com>
 
        * extend.c: 
index d780b96..e447044 100644 (file)
@@ -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");