Commit Graph

228 Commits (master)

Author SHA1 Message Date
Theodore Ts'o 133a56dc9d ChangeLog, message.c, pass1b.c, pass2.c, pass3.c, problem.c, problem.h:
pass1b.c: Change routines to use PR_1B_BLOCK_ITERATE when reporting
  	problems rather than using com_err directly.
  problem.c, problem.h (PR_1B_BLOCK_ITERATE): Add new problem code.
  message.c (expand_percent_expression): Add safety check.  If ctx->str
  	is NULL, print "NULL" instead of dereferencing the null pointer.
  pass1b.c, pass2.c, pass3.c: Change calls to ext2fs_block_iterate to
  	ext2fs_block_iterate2, to support 64-bit filesizes and to speed things
  	up slightly by avoiding the use of the ext2fs_block_iterate's
  	compatibility shim layer.
version.h:
  Update for WIP release.
2000-11-17 05:40:49 +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 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 bbd47d76b7 ChangeLog, pass5.c, problem.c, problem.h:
pass5.c (check_block_bitmaps, check_inode_bitmaps): Add error checking
  	for a "should never happen case".
  problem.c, problem.h (PR_5_COPY_IBITMAP_ERROR,
  	PR_5_COPY_BBITMAP_ERROR): Add new error codes.
2000-06-10 19:21:33 +00:00
Theodore Ts'o d647a1ea4d ChangeLog, pass1.c, problem.c, problem.h:
pass1.c (pass1, check_size): Apply patch from Chris Wedgewood
  	(cw@foof.org) which checks to see if special devices have a non-zero
  	size, and deals with it.
  problem.c, problem.h (PR1_SET_NONZSIZE): Add new problem code.
2000-05-27 14:40:09 +00:00
Theodore Ts'o 4ea0a1109d ChangeLog, problem.c, problem.h, super.c:
problem.c, problem.h (PR_0_HURD_CLEAR_FILETYPE): Add new problem code.
  super.c (check_super_block): If the OS type in the superblock is the
  	Hurd, check to see if the filetype feature is set, and offer to clear
  	it if so.  This needs to be done since the Hurd doesn't properly
  	support the filetype feature.  (And since the hurd allows the
  	transmogrification of files to special files and vice versa --- for no
  	good reason that I can understand --- it can't support the filetype
  	feature for the forseeable future, either.)
ChangeLog, mke2fs.c:
  mke2fs.c (main): We forcibly turn off the filetype feature if the OS
  	is the hurd, since the hurd doesn't support it.  (And since the hurd
  	allows the transmogrification of files to special files and vice versa
  	--- for no good reason that I can understand --- it can't support the
  	filetype feature for the forseeable future, either.)
  mke2fs.c (proceed_question): Fix reversed sense of proceed_question
  	that was busted due to the internationalization patch.  Fixed bug
  	where if proceed_question was called twice, the input buffer wasn't
  	cleared of the previous question's newline.
ChangeLog, expect.1, expect.2, image.gz, name:
  f_hurd: Add test for Hurd-specific features (right now, just checks to
  	make sure the filetype feature is cleared)
ChangeLog, ls.c:
  ls.c (list_super): Change the string displayed for the Hurd to be
  	GNU/Hurd, instead of just "GNU".
2000-05-08 13:33:17 +00:00
Theodore Ts'o 01fbc70141 ChangeLog, pass1.c, problem.c:
pass1.c (check_immutable, e2fsck_pass1_check_device_inode): Check for
  	the append-only as well as the immutable flag.
  problem.c (PR_1_SET_IMMUTABLE): Adjust message to include append-only
  	flag.  Fix comment for compression flag.
2000-04-03 13:57:21 +00:00
Theodore Ts'o 1917875fcd Many files:
unix.c (main): If compression is enabled on the filesystem, print a
  	warning message (for now).
  message.c: Add new compression shortcut: @c == compress
  problem.c, problem.h (PR_1_COMPR_SET): Add new error code.
  pass1.c (check_blocks): If the inode has EXT2_COMPRBLK_FL flag set,
  	check to see if the filesystem supports compression.  If it does pass
  	this information down to process_block() so it can treat the
  	compressed block flag words correctly.  If not, offer to clear the
  	flag, since it shouldn't be set.
  	(process_block): If an inode has the compressed inode flag set, allow
  	EXT2FS_COMPRESSED_BLKADDR.
  pass1b.c (process_pass1b_block, delete_file_block, clone_file_block):
  pass2.c (deallocate_inode_block): Use HOLE_BLKADDR to check to see if
  	the block can be skipped.
ChangeLog, Makefile.in:
  Makefile.in: Exclude the internationalization files from being
  	distributed.
ChangeLog, configure, configure.in:
  configure.in: Add support for --enable-compression.  This is
  	experimental code only for now, which is why it's under --enable test.
  	Once it's stable, it will always be compiled in.
TODO:
  Commit additional TODO items.
2000-02-11 15:55:07 +00:00
Theodore Ts'o 0c4a07264e Many files:
badblocks.c, e2fsck.h, ehandler.c, emptydir.c, extend.c, flushb.c,
  	iscan.c, message.c, pass1.c, pass1b.c, pass3.c pass4.c, pass5.c,
  	problem.c, scantest.c, swapfs.c, unix.c, util.c: Add
  	Internationalization support as suggested by Marco d'Itri
  	<md@linux.it>.
2000-02-07 03:11:03 +00:00
Theodore Ts'o a846d2f499 ChangeLog, problem.c, problemP.h:
problem.c (fix_problem): Support a new flag, PR_PREEN_NO which means
  	the answer is assumed to be no in preen mode.  This is now used in the
  	PR_1_SET_IMMUTABLE code, so that in preen mode we ignore these inodes
  	and just print a warning message.
1999-11-10 15:50:24 +00:00
Theodore Ts'o 6fdc7a325c ChangeLog, e2fsck.h, pass1.c, pass2.c, pass3.c, problem.c, problem.h, util.c:
pass1.c (e2fsck_pass1): If the filesystem does not support imagic
  	inodes, if an inode has the imagic flag set, offer to clear the imagic
  	flag.  If a valid device/fifo/socket has the immutable flag set, call
  	the new helper function check_immutable() to offerto clear the
  	immutable flag.
  pass2.c (check_filetype): Use the new ext2_file_type() helper function
  	instead of calculating the file_type information manually.
  pass3.c (e2fsck_reconnect_file): When adding a link to lost+found,
  	calculate the filetype information so that ext2fs_link() can use the
  	information if applicable.  (get_lost_and_found): Create the
  	/lost+found directory with the correct filetype information if
  	applicable.
  util.c (ext2_file_type), e2fsck.h: New function which returns the
  	directory entry file type information given the inode's mode bits.
  problem.c, problem.h: Added new problem codes PR_1_SET_IMAGIC and
  	PR_1_SET_IMMUTABLE.
ChangeLog, mke2fs.8.in:
  mke2fs.8.in: Update manual page so that the sparse_option filesystem
  	option is properly named.
1999-11-10 13:34:40 +00:00
Theodore Ts'o c40db6d571 ChangeLog, pass2.c, problem.c, problem.h:
problem.c, problem.h (PR_2_NULL_NAME): Add new problem code.
  pass2.c (check_dir_block): Require that the length of the directory
  	entry be at least 12 bytes.  Check to see if the filename is
  	zero-length, and flag that as an error.
1999-10-25 21:03:34 +00:00
Theodore Ts'o 7847c1d4ff ChangeLog, pass2.c, problem.c, problem.h:
pass2.c (check_filetype): If the filetype filesystem feature is not
  	set, and a directory entry has a dirent feature, offer to clear it
  	(since 2.0 kernels will do complain will interpret it as a very large
  	name length field).
1999-10-22 15:11:42 +00:00
Theodore Ts'o aa4115a47c Many files:
pass4.c (e2fsck_pass4): If an inode is set in the inode_imagic_map
  	bitmap, don't check to see if it is disconnected from the inode tree
  	(because it almost certainly will be).  Free inode_imagic_map at the
  	end of pass 4.
  pass2.c (check_dir_block, check_filetype): If the FILETYPE feature is
  	set, check the directory entry's filetype information field, and
  	fix/set it if necessary.  (e2fsck_pass2): Free the inode_reg_map
  	bitmap at the end of pass 2.
  pass1.c (e2fsck_pass1, alloc_imagic_map): Allocate and fill in
  	information for inode_reg_map and inode_imagic_map, which indicates
  	which inodes are regular files and AFS inodes, respectively.
  	Since only the master superblock is written during a restart, force
  	that superblock to be used after a restart; otherwise changes to the
  	block group descriptors end up getting ignored.
  problem.c, problemP.h: If e2fsck is run -n, make def_yn variable be 0
  	for "no".  Add support for a new flag, PR_NO_NOMSG, which supresses
  	the problem message if e2fsck is run with the -n option.
  problem.c, problem.h (PR_2_SET_FILETYPE, PR_2_BAD_FILETYPE): Add new
  	problem codes.
  message.c (expand_dirent_expression): Add support for %dt which prints
  	the dirent type information.
  e2fsck.c (e2fsck_reset_context): Free new bitmaps (inode_reg_map and
  	inode_imagic_map).
  e2fsck.h (e2fsck_t): Add new inode_reg_map and inode_magic_map to the
  	context structure.
ChangeLog, nt_io.c:
  nt_io.c: New file which supports I/O under Windows NT.
ChangeLog, gen_uuid_nt.c:
  gen_uuid_nt.c: New file which creates a UUID under Windows NT.
Many files:
  Add support for non-Unix compiles
1999-10-21 19:33:18 +00:00
Theodore Ts'o d4b0ce0316 ChangeLog, problem.c, problem.h, super.c:
problem.c, problem.h (PR_0_INODE_COUNT_WRONG): Add new problem code.
  super.c (check_super_block): Add check to make sure the total number
  	of inodes is sane, since this can be calculated from the number of
  	groups times the number of inodes per group.  Offer to correct it if
  	it is incorrect.
1999-06-18 01:09:29 +00:00
Theodore Ts'o 4a9f59366b ChangeLog, pass3.c, problem.c, problem.h, util.c:
util.c (print_resource_track): Use mallinfo if present to get more
  	accurate malloc statistics.
  pass3.c (get_lost_and_found): Check to see if lost+found is a plain
  	fail; if so, offer to unlink it.
  problem.c, problem.h (PR_3_LPF_NOTDIR): Add new problem code.
  problem.c: Fix problem message for PR_1_BAD_GROUP_DESCRIPTORS so that
  	the block group number is printed.  Add new prompt, PROMPT_UNLINK.
1999-03-16 19:32:52 +00:00
Theodore Ts'o 5a679c8fb1 ChangeLog, pass3.c, problem.c:
pass3.c (get_lost_and_found): If the filesystem is not opened
  	read-only, then force /lost+found to be created if it is not present.
  problem.c: Allow PR_3_NO_LF_DIR to be handled during a preen operation.
ChangeLog, Makefile.in:
  Makefile.in: Updated dependencies.
ChangeLog, fsck.c:
  fsck.c (load_fs_info): Parse /etc/fstab ourselves, instead of relying
  	on getmntent().  This has the advantage of allowing us to properly
  	handle missing pass numbers correctly.
ChangeLog, configure.in:
  configure.in: Add paths.h to header files for which we search.
1998-12-03 16:40:38 +00:00
Theodore Ts'o 1dde43f0c1 ChangeLog, mke2fs.c, tune2fs.8.in:
tune2fs.8.in: Fix minor display bug in the nroff.
  mke2fs.c (show_stats, write_inode_tables): Use the log10 function to
  	calculate the display of block numbers so that things look nice on an
  	80 character display.
  mke2fs.c (usage): Add the sparse-super-flag to the usage message.
ChangeLog, e2fsck.c, pass1.c, pass2.c, problem.c, problem.h, unix.c:
  unix.c (main): Move ext2fs_close() after e2fsck_free_context() since
  	e2fsck_free_context may reference data in ctx->fs.
  e2fsck.c (e2fsck_reset_context): Make sure ctx->fs is non-NULL before
  	checking ctx->fs->dblist.
  pass1.c (e2fsck_pass1): Use the device check subroutine on FIFO's and
  	Socket's, so that we catch bogus immutable inodes.
  pass2.c (process_bad_inode): Process bad socket and fifo's.
  problem.h, problem.c: Define new problem codes PR_2_BAD_FIFO and
  	PR_2_BAD_SOCKET.
1998-11-14 04:18:28 +00:00
Theodore Ts'o 7f813ba337 ChangeLog, pass3.c, pass4.c, problem.c, problem.h, super.c:
problem.c: Add PR_3_NO_DIRINFO error code.
  super.c (check_super_value): Rename min and max to min_val and max_val
  	to avoid possible cpp macro conflicts.
  pass4.c (e2fsck_pass4): Rename max to maxgroup, to avoid possible cpp
  	macro conflicts.
  pass3.c (e2fsck_pass3): Rename max to maxdirs, to avoid possible cpp
  	macro conflicts.
  	(check_directory): Fix logic to avoid possible core dump in the
  	case of ext2fs_get_dir_info returning NULL.  (By the time we get here,
  	it should never happen, but...).  Also simply/streamline the control
  	flow of the function.
1998-09-03 01:26:03 +00:00
Theodore Ts'o 246501c612 Many files:
unix.c: Fix bug in check of feature set, to make sure we can really
  	fix this filesystem.
  problem.h: Make blkcount type to be of type blkcnt_t.  Make the num
  	field be a 64 bit type.  Add the problem code PR_1_FEATURE_LARGE_FILES
  problem.c: Add table entry for the problem code PR_1_FEATURE_LARGE_FILES.
  pass1.c (e2fsck_pass1): A non-zero i_dir_acl field is only a problem
  	for directory inodes.  (Since it is also i_size_high now.)  If there
  	are no large_files, then clear the LARGE_FLAG feature flag.  If there
  	are large_files, but the LARGE_FLAG feature flag is not set, complain
  	and offer to fix it.
  	(check_blocks): Add support to deal with non-directory inodes that
  	have i_size_high set (i.e., large_files).  Don't give an error if a
  	directory has preallocated blocks, to support the DIR_PREALLOC
  	feature.
  	(process_block, process_bad_block): The blockcnt variable is a type of
  	blkcnt_t, for conversion to the new block_iterate2.
  pass2.c (process_bad_inode): A non-zero i_dir_acl field is only a
  	problem for directory inodes.  (Since it is also i_size_high now.)
  message.c (expand_inode_expression): Print a 64-bits of the inode size
  	for non-directory inodes.  (Directory inodes can only use a 32-bit
  	directory acl size, since i_size_high is shared with i_dir_acl.)  Add
  	sanity check so that trying to print out the directory acl on a
  	non-directory inode will print zero.  (expand_percent_expression): %B
  	and %N, which print pctx->blkcount and pctx->num, can now be 64 bit
  	variables.  Print them using the "%lld" format if EXT2_NO_64_TYPE is
  	not defined.
  e2fsck.h: Add the large_flagsfield to the e2fsck context.
  e2fsck.c (e2fsck_reset_context): Clear the large_flags field.
ChangeLog, expect.1:
  f_messy_inode: Modify test to deal with changes to support 64-bit size
  	files.  (/MAKEDEV had i_dir_acl, now i_size_high, set.)
1998-03-24 16:22:38 +00:00
Theodore Ts'o f8188fff23 Many files:
pass1.c, pass2.c, pass3.c, pass4.c, pass5.c: Add calls to the progress
  	indicator function.
  pass1.c (scan_callback): Add call to the progress feedback function
  	(if it exists).
  super.c (check_super_block): Skip the device size check if the
  	get_device_size returns EXT2_EXT_UNIMPLEMENTED.
  iscan.c (main): Don't use fatal_error() anymore.
  pass1b.c, swapfs.c, badblocks.c: Set E2F_FLAG_ABORT instead of calling
  	fatal_error(0).
  problem.c, pass3.c (PR_3_ROOT_NOT_DIR_ABORT,
  	PR_3_NO_ROOT_INODE_ABORT): New problem codes.
  problem.c, pass2.c (PR_2_SPLIT_DOT): New problem code.
  problem.c, pass1.c (PR_1_SUPPRESS_MESSAGES): New problem code.
  problemP.h: New file which separates out the private fix_problem data
  	structures.
  util.c, dirinfo.c, pass1.c, pass1b.c, pass2.c, pass5.c, super.c,
  	swapfs.c util.c: allocate_memory() now takes a e2fsck context as its
  	first argument, and rename it to be e2fsck_allocate_memory().
problemP.h:
  New file which contains the private problem abstraction definitions.
Makefile.pq:
  Remove include of MAKEFILE.STD, which doesn't exist at this point.
1997-11-14 05:23:04 +00:00
Theodore Ts'o 1b6bf1759a Many files:
pass*.c, super.c: Massive changes to avoid using printf and com_err
  	routines.  All diagnostic messages are now routed through the
  	fix_problem interface.
  pass2.c (check_dir_block): Check for duplicate '.' and '..' entries.
  problem.c, problem.h: Add new problem codes PR_2_DUP_DOT and
  	PR_2_DUP_DOT_DOT.
  problem.c: Added new problem codes for some of the superblock
  	corruption checks, and for the pass header messages.  ("Pass
  	1: xxxxx")
  util.c (print_resource_track): Now takes a description argument.
  super.c, unix.c, e2fsck.c: New files to separate out the
  	operating-specific operations out from e2fsck.c.  e2fsck.c now
  	contains the global e2fsck context management routines, and
  	super.c contains the "pass 0" initial validation of the
  	superblock and global block group descriptors.
  pass1.c, pass2.c, pass3.c, pass4.c, pass5.c, util.c: Eliminate
  	(nearly) all global variables and moved them to the e2fsck
  	context structure.
  problem.c, problem.h: Added new problem codes PR_0_SB_CORRUPT,
  	PR_0_FS_SIZE_WRONG, PR_0_NO_FRAGMENTS, PR_0_BLOCKS_PER_GROUP,
  	PR_0_FIRST_DATA_BLOCK
expect.1, expect.2:
  Updated tests to align with e2fsck problem.c changes.
1997-10-03 17:48:10 +00:00
Theodore Ts'o 7cf73dcd3d ChangeLog, e2fsck.h, message.c, pass1.c, pass2.c, problem.c, problem.h:
message.c: Add compression for the word "Illegal"
  problem.c: Added entries for PR_2_BAD_CHAR_DEV and PR_2_BAD_BLOCK_DEV
  pass1.c (pass1, check_device_inode), pass2.c (process_bad_inode): Use
  	a more stringent test for a valid device.
ChangeLog, Makefile.in:
  Makefile.in (install): Fix rm command to use $(DESTDIR) appropriately.
1997-08-14 17:17:16 +00:00
Theodore Ts'o da2e97f7cf ChangeLog, pass1.c, problem.c:
pass1.c (mark_table_blocks): Mark the superblock and group descriptor
  	blocks first, so that any conflicts between these and the bitmap or
  	inode table blocks is noticed.
  problem.c: Fix message printed out when a block or inode bitmap
  	conflicts with other fs data, has the correct group number in it.
1997-06-12 04:28:07 +00:00
Theodore Ts'o 521e368572 Many files:
Checked in e2fsprogs 1.08.
1997-04-29 17:48:10 +00:00
Theodore Ts'o 21c84b71e2 Many files:
Checked in e2fsprogs-1.07
1997-04-29 16:15:03 +00:00