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
#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 */
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;
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);
}
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;
}