Commit Graph

34 Commits (0684a4f33b5c268fe12f57fcbc77a880c79ab282)

Author SHA1 Message Date
Theodore Ts'o 0684a4f33b Overhaul extended attribute handling. Should now be correct with
respect to the latest V2 bestbits ACL code.
2002-08-17 10:19:44 -04:00
Theodore Ts'o 850d05e9aa Add e2fsck -D option which optimizes/compresses directories.
General cleanup of rehash code.  (Fixed a few bugs, reformatted
code to make it more maintainable, etc.)
2002-07-25 00:00:08 -04:00
Theodore Ts'o 4cae04529e Add SIGINT and SIGTERM handling to fsck and e2fsck. For e2fsck,
make sure we gracefully clean up and only exit at safe points.
For fsck, we pass the SIGINT/SIGTERM signal to the child processes,
so they can do their own cleanup.
2002-07-21 14:14:03 -04:00
Theodore Ts'o b7a00563b2 Add support to e2fsck to reindex directories to use hash trees. 2002-07-20 00:28:07 -04: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 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 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 28ffafb09c ChangeLog, bitops.h:
bitops.h (ext2fs_mark_generic_bitmap, ext2fs_unmark_generic_bitmap,
  	ext2fs_mark_block_bitmap, ext2fs_unmark_block_bitmap,
  	ext2fs_mark_inode_bitmap, ext2fs_unmark_inode_bitmap): Change to
  	return the previous state of the bit that is being marked or unmarked.
  	For speed optimization.
ChangeLog, pass3.c:
  pass3.c (check_directory): Only do the loop detection algorithm if
  	we've searched over 2048 parent directories and haven't found the end
  	yet.  This means that in the common case, we don't allocate or clear
  	the inode_loop_detection bitmap, which for large systems, merely
  	clearing the bitmap for each directory was turning out to be quite
  	expensive.  Thanks to Jani Jaakkola (jjaakkol@cs.helsinki.fi) for
  	identifying this problem.
ChangeLog, Makefile.in, e2fsck.h, unix.c:
  Makefile.in: Call sync after finishing building all in this directory.
  unix.c (PRS): sync the filesystem before trying to use BLKFLSBUF, to
  	minimize the chance of causing dirty blocks to get dropped.
  e2fsck.h: Manually define BLKFLSBUF if not defined, and we're on a
  	Linux/i386 system.
2000-02-08 19:14:02 +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 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 c1faf9cc3a ChangeLog, pass1b.c:
pass1b.c (clone_file_block): Don't clear the dup_map flag if the block
  	also shares data with the fs metadata when the count drops to 1, since
  	the block should still be cloned, as fs metadata isn't included in the
  	count.
ChangeLog, pass3.c:
  pass3.c (adjust_inode_count): Fix bug where we didn't keep the
  	internal and external inode counts in sync when we decremented an
  	inode whose link count was already zero.  Now we skip incrementing or
  	decrementing both link counts if we would cause an overflow condition.
  	(expand_dir, expand_dir_proc): Change where we update the inode block
  	count and size files so that the block count field is updated
  	correctly when we create an indirect block.
1999-09-14 20:00:54 +00:00
Theodore Ts'o 5596defa1e Many files:
unix.c: Add support for calculating a progress bar if the -C0 option
  	is given.  The function e2fsck_clear_progbar() clears the progress bar
  	and must be called before any message is issued.  SIGUSR1 will enable
  	the progress bar, and SIGUSR2 will disable the progress bar.  This is
  	used by fsck to handle parallel filesystem checks.  Also, set the
  	device_name from the filesystem label if it is available.
  e2fsck.h: Add new flags E2F_FLAG_PROG_BAR and E2F_FLAG_PROG_SUPRESS.
  	Add new field in the e2fsck structure which contains the last tenth of
  	a percent printed for the user.
  message.c (print_e2fsck_message): Add call to e2fsck_clear_progbar().
  pass1.c (e2fsck_pass1):
  pass2.c (e2fsck_pass2):
  pass3.c (e2fsck_pass3):
  pass4.c (e2fsck_pass4):
  pass5.c (e2fsck_pass5): Add call to e2fsck_clear_progbar when printing
  	the resource tracking information.
  pass5.c (check_block_bitmaps, check_inode_bitmaps): If there is an
  	error in the bitmaps, suppress printing the progress bar using the
  	suppression flag for the remainder of the check, in order to clean up
  	the display.
1999-07-19 15:27:37 +00:00
Theodore Ts'o c54b3c3c99 ChangeLog, pass3.c:
Fix some stupid spelling typo's.
ChangeLog:
  Fix e-mail address.
1999-07-03 07:20:06 +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 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 f75c28de47 ChangeLog, e2fsck.c, pass2.c, pass3.c, unix.c:
pass2.c (e2fsck_pass2): Fix the progress accounting so that we get to
  	100%.
  pass3.c (e2fsck_pass3): Change progress accounting to be consistent
  	with the other e2fsck passes.
  e2fsck.c (e2fsck_run): At the end of each pass, call the progress
  	function with the pass number set to zero.
  unix.c (e2fsck_update_progress): If the pass number is zero, ignore
  	the call, since that indicates that we just want to deallocate any
  	progress structures.
emptydir.c:
  Commit partially done file.
ChangeLog, badblocks.c:
  badblocks.c (ext2fs_badblocks_list_add): Use a bigger increment than
  	10 blocks when we need to expand the size of the badblocks list.
1998-08-01 04:18:06 +00:00
Theodore Ts'o b6f7983197 ChangeLog, message.c, pass2.c, pass3.c:
Mask off the high eight bits of the directory entry's name_len field,
  so that it can be used for other purposes.
1998-03-09 13:10:37 +00:00
Theodore Ts'o a02ce9df5f Many files:
Change the progress function to return an integer; if returns 1, then
  the progress function is expected to have set the e2fsck context flag
  signalling a user abort, and the caller should also initiate a user
  abort.
1998-02-24 20:22:23 +00:00
Theodore Ts'o 4313932cd7 ChangeLog, e2fsck.8.in, e2fsck.h, pass3.c, pass4.c, super.c:
e2fsck.h: Add new field, priv_data to the e2fsck context structure.
  	It should be used by callers of the e2fsck functions only, and not by
  	anything in e2fsck itself.
  super.c: Instead of call ext2fs_get_device_size(), define and call
  	e2fsck_get_device_size().  (This function may be stubbed out in
  	special versions of e2fsck.)
  pass3.c, pass4.c: Remove extra calls to the progress function that
  	weren't needed.
  mke2fs.8.in: Update man page to note that the format of the bad block
  	file is the same as the one generated by badblocks.
1998-02-16 22:34:46 +00:00
Theodore Ts'o 54dc7ca286 Many files:
e2fsck.h: If EXT2_FLAT_INCLUDES is defined, then assume all of
  	the ext2-specific header files are in a flat directory.
  dirinfo.c, ehandler.c, pass1.c, pass1b.c, pass2.c, pass5.c,
  	super.c, swapfs.c, unix.c: Explicitly cast all assignments
  	from void * to be compatible with C++.
  unix.c (sync_disk): Remove sync_disk and calls to that function,
  	since ext2fs_close() now takes care of this.
  pass1.c, pass1b.c, pass2.c, pass3.c, swapfs, badblocks.c,
  	ehandler.c, unix.c: Change use of private to be priv_data, to
  	avoid C++ reserved name clash.
1998-01-19 14:50:49 +00:00
Theodore Ts'o b8647faa3b ChangeLog, pass3.c:
Fix bug which could cause core dump when expanding the directory, and
  the bitmaps hadn't yet been read in.  Also, only use
  ext2fs_write_dir_block when writing a directory block, not when
  writing out a fresh indirect block.
1997-11-20 21:52:43 +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 08b213017f Many files:
Change ext2fs_read_inode, ext2fs_write_inode to take the e2fsck
  context as their first argument.
  Change dir_info.c routines to take an e2fsck_context, renamed them to
  start with e2fsck_ to avoid namespace issues, and changed them to
  store the directory information inside the e2fsck context.
  Added e2fsck_run() which calls all of the e2fsck passes in the correct
  order, and which handles the return of abort codes.
  Added abort processing, both via setjmp/longjmp and via flags in the
  e2fsck context.
  Use a flag in the e2fsck context instead of the restart_e2fsck global
  variable.
  Change uses of free and malloc to ext2fs_free_mem and ext2fs_get_mem.
1997-11-03 19:42:40 +00:00
Theodore Ts'o 291c9049ba ext2fs.h, ext2_err.et.in, ChangeLog, pass1.c, pass3.c:
Rename new error codes to _ET_ in them for consistency.
ChangeLog, et_c.awk, et_h.awk:
  Remove support for non STDC compilers, since the workarounds caused
  problems with the header file.
Makefile.pq:
  Checkpoint of powerquest work.
1997-10-31 06:17:08 +00:00
Theodore Ts'o c555aebde4 Many files:
alloc.c (ext2fs_alloc_block): New function which allocates a
  	block and updates the filesystem accounting records
  	appropriately.
  ext2_err.et.in: Added new error codes: EXT2_NO_MEMORY,
  	EXT2_INVALID_ARGUMENT, EXT2_BLOCK_ALLOC_FAIL, EXT2_INODE_ALLOC_FAIL,
  	EXT2_NOT_DIRECTORY
  Change various library files to use these functions instead of EINVAL,
  ENOENT, etc.
ChangeLog, pass1.c, pass3.c:
  pass3.c (get_lost_and_found): Check error return of
  	EXT2_FILE_NOT_FOUND instead of ENOTDIR
  pass1.c (pass1_check_directory): Return EXT2_NO_DIRECTORY instead of
  	ENOTDIR
expect.icount:
  Change expected error string to be "Invalid argument passed to ext2 library"
  instead of just "Invalid argument"
1997-10-25 04:16:53 +00:00
Theodore Ts'o 8bf191e866 Many files:
Place #ifdef RESOURCE_TRACK around code which uses init_resource_track
  and print_resource_track.  (Not all systems have timeval)
1997-10-20 01:38:32 +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 21c84b71e2 Many files:
Checked in e2fsprogs-1.07
1997-04-29 16:15:03 +00:00
Theodore Ts'o 7f88b04341 Many files:
Checkin of e2fsprogs 1.03.
1997-04-26 14:48:50 +00:00
Theodore Ts'o 50e1e10fa0 Many files:
Checked in e2fsprogs 0.5c
1997-04-26 13:58:21 +00:00
Theodore Ts'o f3db3566b5 Many files:
Checkin of e2fsprogs 0.5b
1997-04-26 13:34:30 +00:00
Theodore Ts'o 3839e65723 Many files:
Checkin of e2fsprogs 0.5b
1997-04-26 13:21:57 +00:00