Commit Graph

82 Commits (d1154eb460efe588eaed3d439c1caaca149fa362)

Author SHA1 Message Date
Theodore Ts'o 6d222f3217 Fix memory leaks in e2fsck's journal.c, and remove some cases
which look like memory leaks in unix.c so we can more easily find
the true memory leaks.
2001-07-29 12:06:58 -04:00
Theodore Ts'o adee8d75db Add support for use of an external journal (so long as the external
journal only has one filesystem).
2001-07-23 00:17:49 -04:00
Theodore Ts'o 0f2cfe2579 Fix really stupid typo. 2001-07-10 14:34:41 -04:00
Theodore Ts'o 3c6b8977d4 Speed up journal recovery in userspace by avoiding a pointless
unconditional ext2_flush() call.  Also made ext2_flush() more
efficient when the superblock is modified after the filesystem has
been flushed, and make it clear the superblock dirty flag
after doing the superblock/block group descriptor flush.
2001-07-10 14:27:58 -04:00
Theodore Ts'o 2f686ace1c ChangeLog, journal.c, problem.c, problem.h:
problem.c, problem.h: Change PR_0_JOURNAL_UNSUPP_INCOMPAT and
  	PR_0_JOURNAL_UNSUPP_ROCOMPAT so they aren't fatal errors, but prompt
  	to see if the user should abort.  Removed the
  	PR_0_JOURNAL_RESET_COMPAT problem code.
  journal.c (e2fsck_journal_load): If there are incompatible journal
  	flags, just return an error code.
  	(e2fsck_check_ext3_journal): If e2fsck_journal_load returns an error
  	code indicating that there are incompatible journal flag, check to see
  	if we should abort, and then offer to clear the journal.
2001-06-02 00:38:40 +00:00
Theodore Ts'o 561cd4dd60 ChangeLog, journal.c:
journal.c (e2fsck_journal_reset_super): Remove extraneous line
2001-05-25 16:40:56 +00:00
Theodore Ts'o c7f23364fd ChangeLog, journal.c, problem.c, problem.h:
journal.c (e2fsck_journal_reset_super): Fix bug; the reset journal
  	wasn't getting written out to disk since the dirty bit wasn't being
  	set on the buffer.
  	(e2fsck_journal_load): Don't print an error message if the journal
  	version number is wrong; just return a error code reflecting this
  	fact.  If the block type in the journal superblcok is obviously not a
  	version number, report the journal is corrupted.
  	(e2fsck_check_ext3_journal): On an unsupported journal version, prompt
  	to abort by default, but then offer a chance to clear the journal as
  	corrupt.
  problem.c, problem.h (PR_0_JOURNAL_UNSUPP_VERSION): Added new problem code.
2001-05-23 22:19:47 +00:00
Theodore Ts'o 424cd2beb7 ChangeLog, e2fsck.h, journal.c, problem.c, problem.h, super.c:
super.c (check_super_block): Be more strict on checking
  	s_r_blocks_count superblock field.
  problem.c, problem.h (PR_0_JOURNAL_UNSUPP_ROCOMPAT,
  	PR_0_JOURNAL_UNSUPP_INCOMPAT, PR_0_JOURNAL_RESET_COMPAT): New problem
  	codes.
  journal.c (e2fsck_journal_load): Use a problem code to report
  	unsupported feature flags.  There is code to clear unsupported flags,
  	but since this is dangerous, it's not allowed in the problem code
  	table.
  journal.c (e2fsck_journal_reset_super): initialize the journal
  	sequence number to a random value to avoid recovering bad transactions
  	from a corrupt journal.
2001-05-14 04:06:56 +00:00
Theodore Ts'o 328a5ce4ae ChangeLog, journal.c:
journal.c: Code cleanup; initialize journal_enable_debug using an
  	initializer.
2001-05-13 20:21:25 +00:00
Theodore Ts'o 15986f7931 ChangeLog, jfs_user.h, journal.c:
journal.c (mark_buffer_uptodate): Add emulation of kernel function
  	mark_buffer_uptodate.
2001-03-29 19:22:16 +00:00
Theodore Ts'o e9e2a20a11 journal.c:
Fix stupid typo.
2001-02-20 16:31:38 +00:00
Theodore Ts'o d051521278 ChangeLog, journal.c:
journal.c (e2fsck_run_ext3_journal): Force a flush of the filesystem
  	and io_channel before replaying the journal.
2001-02-13 04:32:53 +00:00
Theodore Ts'o 4e009f6a2e journal.c:
Fix minor typo in C comment
2001-02-08 02:26:04 +00:00
Theodore Ts'o a9ca2016e1 ChangeLog, pass1.c, problem.c, problem.h:
pass1.c (e2fsck_pass1): Cap the maximum legal size of a file by the
  	limit caused by the fact that i_blocks is in 512 byte units, and that
  	the Linux buffer cache also fundamentally assumes 512 byte sectors.
  	Make sure that the journal inode is a regular file, and when clearing
  	an unused journal inode, make sure the icount db is updated.
  problem.c, problem.h (PR_1_JOURNAL_BAD_MODE): Add new problem code.
ChangeLog, journal.c:
  journal.c (e2fsck_journal_fix_unsupported_super): Remove unused
  	function.  Add FIXME notes to e2fsck_get_journal(), from Andreas
  	Dilger.
2001-01-12 21:53:25 +00:00
Theodore Ts'o 6a6d3d44d6 ChangeLog, journal.c:
journal.c: Make sure all functions which return an error code use the
  	errcode_t return type, and not "int"
  	(e2fsck_journal_release): Add new parameter, "drop", which is used
  	when we just want to deallocate the journal without trying to write
  	out any changes.
  	(mark_buffer_clean): New function e2fsck_check_ext3_journal): If we
  	fail loading the journal, make sure we free all memory associated with
  	it.
  	(recover_ext3_journal): If we fail to load the journal or initialize
  	the revoke data structures, make sure we free all memory associated
  	with the journal.
2001-01-12 21:11:24 +00:00
Theodore Ts'o 7e92dfae9e ChangeLog, journal.c, problem.c:
journal.c (e2fsck_journal_fix_bad_inode): Set pctx->ino to the bad
  	journal number.
  problem.c (PR_0_JOURNAL_BAD_INODE): Use pctx->ino instead of pctx->num
  	when printing the bad journal inode number.
2001-01-12 15:30:25 +00:00
Theodore Ts'o 86c627ec11 Many files:
dirinfo.c, e2fsck.h, emptydir.c, iscan.c, jfs_user.h, journal.c,
  	message.c, pass1.c, pass1b.c, pass2.c, pass3.c, pass4.c, pass5.c,
  	problem.h, scantest.c, super.c, swapfs.c: Change ino_t to ext2_ino_t.
2001-01-11 15:12:14 +00:00
Theodore Ts'o 53ef44c40a Many files:
journal.c, pass1.c, pass1b.c, pass3.c, recovery.c, revoke.c, super.c,
  	unix.c, util.c: Fix random gcc -Wall complaints.
  jfs_user.h: Use more sophisticated inline handling to allow building
  	with --enable-gcc-wall
2001-01-06 05:55:58 +00:00
Theodore Ts'o 8c2dc52180 journal.c:
Fix typo in comment.
2001-01-03 13:14:23 +00:00
Theodore Ts'o d3f35b6451 ChangeLog, journal.c:
journal.c (e2fsck_check_ext3_journal): Force a fsck if we remove the
  	journal stored on a reserved inode.  Also force a fsck if the journal
  	appears to exist while !NEEDS_RECOVERY, and we forcibly reset the
  	journal.
2001-01-03 13:00:43 +00:00
Theodore Ts'o 5dd8f963d0 ChangeLog, journal.c, pass1.c, super.c, unix.c:
journal.c, pass1.c, super.c, unix.c: Replace use of struct ext2fs_sb
  	with struct ext2_super_block.
ChangeLog, debugfs.c:
  debugfs.c Replace use of struct ext2fs_sb with struct ext2_super_block.
2001-01-01 15:51:50 +00:00
Theodore Ts'o b2f93192a1 ChangeLog, journal.c, problem.h:
problem.h: Fixed numbering of pass1 error messages; an extra 0 had
  	slipped into some of the numbers.  (Pointed out by Andreas Dilger)
  journal.c (e2fsck_journal_fix_corrupt_super): Clean up unnecessary
  	automatic variable.  Add explanatory comment about the kernel
  	emulation routines.  (Suggested by Andreas Dilger)
2000-12-30 20:33:42 +00:00
Theodore Ts'o 9b5657591b ChangeLog, super.c:
super.c (release_orphan_inodes): Fix spelling typo in error message.
ChangeLog, unix.c:
  unix.c (main): Clarify coments (no code changes)
ChangeLog, journal.c:
  journal.c (e2fsck_check_ext3_journal): Check to make sure the journal
  	fields are consistent if any of the superblock fields are set.  (Backs
  	out erroneous change made by sct, pointed out by Andreas.)
2000-12-13 18:50:22 +00:00
Theodore Ts'o f43650c308 ChangeLog, journal.c:
journal.c (e2fsck_check_ext3_journal): If JFS_DEBUG is defined at the
  	top level, set the JFS debuging level to 2.
2000-12-09 06:47:56 +00:00
Theodore Ts'o 0e8a9560d8 Many files:
jfs_e2fsck.h, jfs_user.h: Replaces jfs_compat.h.  The jfs.h file has
  	been moved to the include/linux directory.
  journal.c, revoke.c, recovery.c: Updated files from Stephen to support
  	the V2 superblock and revoke processing.  The journal.c and revoke.c
  	files are copies from the ext3 kernel source.
  Makefile.in: Added revoke.c to the list of source/object files.
Makefile.in:
  Fix up some mistakes in the source file list, and regenerate the
  dependencies.
  Update Makefile dependencies.
ChangeLog, jfs.h:
  jfs.h: Remove excess #include of JFS_DEBUG.  Not needed for e2fsprogs,
  	since we optioanlly define it in the configuration file system.
2000-12-09 06:41:25 +00:00
Theodore Ts'o 241f224fb2 .del-jfs.h~fa6593e8, ChangeLog, jfs_compat.h, journal.c:
jfs.h, jfs_compat.h, journal.c: Updated to include the definition of
  	the new journal superblock format; still only supports V1 superblocks
  	for now.  (From sct)
2000-10-26 20:42:07 +00:00
Theodore Ts'o 8394902e04 ChangeLog, journal.c, problem.c, problem.h, super.c:
super.c (release_inode_block, release_inode_blocks,
  	release_orphan_inodes): Add code to deal with truncating inodes which
  	are still in use (but which are on the orphan list because they need
  	truncation).
  problem.c, problem.h: Rename PR_0_CLEAR_ORPHAN_INODE to
  	PR_0_ORPHAN_CLEAR_INODE, and remove PR_0_ORPHAN_INODE_INUSE.
  journal.c (e2fsck_run_ext3_journal): Add i18n support, and print a
  	message when the journal is being recovered.
2000-10-25 01:38:50 +00:00
Theodore Ts'o 99a2cc969f ChangeLog, jfs_compat.h, journal.c, pass3.c:
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.
2000-08-22 21:41:52 +00:00
Theodore Ts'o ecf1b7767e ChangeLog, journal.c, message.c, problem.c, problem.h, super.c:
journal.c (e2fsck_journal_load): Fix **nasty** bug which caused
  	e2fsck_check_ext3_journal to smash the journal because
  	journal->j_transaction_sequence wasn't getting initialized.
  journal.c: (recover_ext3_journal, e2fsck_run_ext3_journal): Move call
  	to e2fsck_clear_recover from recover_ext3_journal to after the
  	filesystem has been closed and reopened.  Otherwise, the superblock in
  	the filesystem handle will probably be stale, and will overwrite the
  	newer version of the superblock written by the log recovery.
  message.c (expand_inode_expression): Add support for %Iu and %Ig
  problem.h (PR_0_CLEAR_ORPHAN_INODE): Add new problem code.
  super.c (release_orphan_inodes, release_inode_block,
  	release_inode_blocks): Update the block group descriptor counts when
  	freeing the orphan inode.  Use PR_0_CLEAR_ORPHAN_INODE to report when
  	we clear an orphan.
  journal.c (e2fsck_run_ext3_journal): Fix a bug where we attempted to
  	reopen the filesystem using the device name instead of the filesystem
  	name.
2000-08-20 22:06:31 +00:00
Theodore Ts'o 80bfaa3e40 Many files:
Makefile.in: Update the make dependencies
  problem.c, problem.h: Add the problem codes:
  	PR_0_ORPHAN_ILLEGAL_BLOCK_NUM, PR_0_ORPHAN_ALREADY_CLEARED_BLOCK,
  	PR_0_ORPHAN_ILLEGAL_HEAD_INODE, PR_0_ORPHAN_ILLEGAL_INODE,
  	PR_0_ORPHAN_INODE_INUSE
  super.c (release_inode_blocks, release_orphan_inodes,
  	check_super_block): Add support for clearing orphaned inodes from the
  	unmounted filesystem.
  journal.c (e2fsck_recover_ext3_journal): Remove the last orphan check;
  	this is now handled in check_super_block --- non-journaled filesystems
  	can use the orphan list in the future.  Also, move the the re-opening
  	of the filesystem to e2fsck_run_ext3_journal().
debugfs.c:
  debugfs.c (finish_range): Make sure the pager FILE pointer to use.
configure, configure.in, ChangeLog:
  configure.in (JFS_DEBUG): Add support for --enable-jfs-debug
2000-08-18 15:08:37 +00:00
Theodore Ts'o 3b5386dca8 Many files:
journal.c: implement loading of ext3 journal for recovery code
  problem.c (fix_problem): return answer from PR_AFTER_CODE to caller.
  	Add journal problems.
  recovery.c (journal_recover): user-space ext3 journal recovery code
  unix.c (main) : check journal and do recovery in separate steps
  jfs.h, recovery.c: Files ext3 kernel code.
  jfs_compat.h: Compatibility header file to allow kernel code to be
  	linked to e2fsck.
2000-08-14 14:25:19 +00:00
Theodore Ts'o 17390c047f ChangeLog, Makefile.in, e2fsck.h, journal.c, unix.c:
unix.c (check_if_skip): Modify algorithm for checking s_max_mnt_count
  	to match with the kernel.  (If s_max_mnt_count is negative, ignore the
  	mnt_count check.)
  unix.c (e2fsck_update_progress): Adjust the width of the progress bar
  	dynamically, based on the filesystem name that we need to display.
  unix.c (main): If the ext3 needs_recovery flag is set, call
  	e2fsck_run_ext3_journal() and then restart the e2fsck run.
  journal.c (e2fsck_run_ext3_journal): New file which contains logic to
  	recover the ext3 journal.  This version relies on the kernel being
  	able to mount the filesystem in order to run the journal.
2000-07-07 04:13:21 +00:00