Whamcloud - gitweb
ChangeLog, jfs_compat.h, journal.c, pass3.c:
authorTheodore Ts'o <tytso@mit.edu>
Tue, 22 Aug 2000 21:41:52 +0000 (21:41 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 22 Aug 2000 21:41:52 +0000 (21:41 +0000)
  jfs_compat.h (J_ASSERT):
  journal.c (e2fsck_run_ext3_journal):
  pass3.c (adjust_inode_count): Use fatal_error() instead of exit().
ChangeLog, super.c:
  super.c (release_orphan_inodes): Fix typo; should do bounds checking
   on next_ino instead of ino.

e2fsck/ChangeLog
e2fsck/jfs_compat.h
e2fsck/journal.c
e2fsck/pass3.c
e2fsck/super.c

index e028566..de93ab1 100644 (file)
@@ -1,5 +1,12 @@
 2000-08-22    <tytso@valinux.com>
 
+       * super.c (release_orphan_inodes): Fix typo; should do bounds
+               checking on next_ino instead of ino.
+
+       * jfs_compat.h (J_ASSERT): 
+       * journal.c (e2fsck_run_ext3_journal): 
+       * pass3.c (adjust_inode_count): Use fatal_error() instead of exit().
+
        * unix.c: Use fatal_error() instead of exit() whenever possible.
                Also fix the fsck exit codes so that we use FSCK_USAGE
                when it is appropriate.  Rename global_signal_ctx to
index 1fa49ca..d0e1da5 100644 (file)
@@ -43,12 +43,15 @@ void wait_on_buffer(struct buffer_head *bh);
 #define fsync_dev(dev) do {} while(0)
 #define buffer_req(bh) 1
 #define do_readahead(journal, start) do {} while(0)
+       
+extern e2fsck_t e2fsck_global_ctx;  /* Try your very best not to use this! */
+
 #define J_ASSERT(assert)                                               \
        do { if (!(assert)) {                                           \
                printf ("Assertion failure in %s() at %s line %d: "     \
                        "\"%s\"\n",                                     \
                        __FUNCTION__, __FILE__, __LINE__, # assert);    \
-               exit(FSCK_ERROR);                                       \
+               fatal_error(e2fsck_global_ctx, 0);                      \
        } } while (0)
 
 #endif /* _JFS_COMPAT_H */
index 64c2445..c9f67d0 100644 (file)
@@ -616,7 +616,7 @@ int e2fsck_run_ext3_journal(e2fsck_t ctx)
                com_err(ctx->program_name, retval,
                        _("while trying to re-open %s"),
                        ctx->device_name);
-               exit(FSCK_ERROR);
+               fatal_error(ctx, 0);
        }
        ctx->fs->priv_data = ctx;
 
index e3cd8d1..9344e55 100644 (file)
@@ -581,9 +581,8 @@ static errcode_t adjust_inode_count(e2fsck_t ctx, ino_t ino, int adj)
                inode.i_links_count--;
        } else {
                /* Should never happen */
-               printf(_("Debug error in e2fsck adjust_inode_count, "
-                      "should never happen.\n"));
-               exit(1);
+               fatal_error(ctx, _("Debug error in e2fsck adjust_inode_count, "
+                                  "should never happen.\n"));
        }
        
        retval = ext2fs_write_inode(fs, ino, &inode);
index 8e8c8aa..7875dc1 100644 (file)
@@ -180,8 +180,9 @@ static int release_orphan_inodes(e2fsck_t ctx)
                }
                next_ino = inode.i_dtime;
                if (next_ino &&
-                   ((ino < EXT2_FIRST_INODE(fs->super)) ||
-                    (ino > fs->super->s_inodes_count))) {
+                   ((next_ino < EXT2_FIRST_INODE(fs->super)) ||
+                    (next_ino > fs->super->s_inodes_count))) {
+                       pctx.ino = next_ino;
                        fix_problem(ctx, PR_0_ORPHAN_ILLEGAL_INODE, &pctx);
                        goto abort;
                }