Commit Graph

281 Commits (7e0136332c072ae4b13788867e7f840baaffe0ab)

Author SHA1 Message Date
Theodore Ts'o e4c8e885d2 ChangeLog, Makefile.in:
Makefile.in (install): Install resize2fs in /sbin, not /usr/sbin.
ChangeLog, unix.c:
  unix.c: Also, re-arrange the logic so that we do the time check only
  	after doing the percentage check, and we only advance the spinner if
  	we're about to display it.
ChangeLog:
  Fix minor wording error in Chagelog.
2000-07-05 23:54:46 +00:00
Theodore Ts'o 9226904bfb ChangeLog, unix.c:
unix.c (e2fsck_update_progress): Only save and check the last
  	percentage after multiplying it by 10, nor 1000, since we only need to
  	save values to a tenth of a percent (and the percentage is already
  	from 0 .. 100%, not 0 .. 1).
2000-07-05 18:25:59 +00:00
Theodore Ts'o 373b8337c7 Many files:
badblocks.c, dumpe2fs.c, e2label.c, mke2fs.c, tune2fs.c, uuidgen.c:
  	For platforms that don't define optarg.h, manually define optarg and
  	optind.
ChangeLog, main.c:
  main.c: For platforms that don't define optarg.h, manually define
  	optarg and optind.
ChangeLog, unix.c:
  unix.c: For platforms that don't define optarg.h, manually define
  	optarg and optind.
2000-04-03 16:22:35 +00:00
Theodore Ts'o 0601232332 ChangeLog, e2fsck.h, unix.c:
unix.c (e2fsck_update_progress): Limit the number of updates to the
  	progress bars to 8 times a second.  This allows a 9600 baud console
  	link to keep up.
2000-02-12 20:12:43 +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 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 7142db08c4 ChangeLog, e2fsck.c, pass4.c, problem.h, unix.c:
pass4.c (e2fsck_pass4): Clear inode_imagic_map after freeing it, to
  	prevent it from getting freed twice.
  unix.c (main): Close the filesystem before freeing the context, so
  	that in the event of a free()-related segmentation violation, the
  	filesystem is properly closed and written out.
  e2fsck.c (e2fsck_reset_context): When freeing ctx->inode_reg_map, we
  	weren't zero'ing ctx->inode_reg_map, which could cause a segfault
  	later on in the e2fsck run.
  problem.h (PR_2_SPLIT_DOT): Fix excess zero in problem code (now
  	matches the standard convention).
1999-11-08 18:46:54 +00:00
Theodore Ts'o 9ecd8becf4 ChangeLog, unix.c, util.c:
unix.c (PRS), util.c (ask_yn): Add #ifdef's to make e2fsprogs easier
  	to port to non-Unix platforms.
1999-10-20 18:24:31 +00:00
Theodore Ts'o b55199eaf7 ChangeLog, unix.c:
unix.c (usage): Add minimalist emergency help to the usage message.
1999-07-19 15:37:46 +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 7403335006 ChangeLog, unix.c:
unix.c (check_mount): Clean up the abort message displayed when the
  	filesystem is mounted and either stdout or stdin isn't a tty.
1999-07-01 03:00:47 +00:00
Theodore Ts'o 813bbb25a2 ChangeLog, dir_iterate.c:
dir_iterate.c (ext2fs_process_dir_block): Check for corrupted
  	directory entry before calling the callback function.  This should
  	prevent some core dumps of insufficiently paranoid callback functions.
ChangeLog, unix.c:
  unix.c (main): Add missing space in the disk write-protected message.
1999-06-22 03:17:45 +00:00
Theodore Ts'o 75d83bec5f unix.c, ChangeLog:
unix.c (reserve_stdio_fds): Add safety check in case reserve_stdio_fds
  	couldn't open /dev/null.
1999-05-18 03:16:36 +00:00
Theodore Ts'o 73f17cfc39 ChangeLog, unix.c:
unix.c (main): Reset the context before calling ext2fs_close(), to
  avoid referencing already freed memory.
ChangeLog, llseek.c:
  llseek.c (ext2fs_llseek): Change ext2fs_llseek() in the non-Linux case
  	to use EINVAL by default, unless it isn't defined, in which case we
  	use EXT2_ET_INVALID_ARGUMENT instead.
ChangeLog, mk_cmds.sh.in:
  mk_cmds.sh.in: Fixed portability bug in shell script; we were
  	depending on a bash'ism.
ChangeLog, uuid.c:
  uuid.c: Use asm/types.h instead of linux/types.h, to be consistent
  	with other locations where we've had to do this to work around glibc.
1999-01-04 07:35:45 +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 24fc5032b5 ChangeLog, unix.c:
unix.c (check_if_skip): Move the "not cleanly mounted" check ahead of
  	the maximal mount and too long since checked tests.
  (reserve_stdio_fds): Make sure 0,1,2 file descriptors are open, so
  	that we don't open the filesystem using the same file
  	descriptor as stdout or stderr.
1998-08-26 15:23:31 +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 8144d67995 ChangeLog, unix.c:
unix.c (main): Fix typo in checking the incompat feature set; it
  	should be checked against EXT2_LIB_FEATURE_INCOMPAT_SUPP.
1998-07-09 05:33:18 +00:00
Theodore Ts'o 818180cdfc ChangeLog, debugfs.8.in, debugfs.c:
Add a -V option which displays the current version.
ChangeLog, unix.c:
  unix.c (e2fsck_update_progress): Remove unused variables.
ChangeLog, inode.c:
  inode.c (get_next_blockgroup): Fix bug where if get_next_blockgroup()
  	is called early because of a missing inode table in a block group, the
  	current_inode counter wasn't incremented correctly.
ChangeLog, tst_uuid.c:
  tst_uuid.c (main): Fixed bogus declaration of the main's argv parameter.
ChangeLog, test_icount.c:
  test_icount.c (main): Fix main() declaration so that it returns int,
  	not void.
Many files:
  fsck.c (ignore): Remove unused variable cp.
  chattr.c (fatal_error):
  tune2fs.c (usage):
  lsattr.c (usage):
  dumpe2fs.c (usage):
  badblocks.c (usage): Remove volatile from declaration.
  fsck.c: Change use of strdup to be string_copy, since we don't trust
  	what glibc is doing with strdup.  (Whatever it is, it isn't pretty.)
1998-06-27 05:11:14 +00:00
Theodore Ts'o efac9a1b8d ChangeLog, e2fsck.8.in, e2fsck.h, pass5.c, unix.c:
unix.c (PRS): Added new option -C, which causes e2fsck to print
  	progress updates so that callers can keep track of the completion
  	progress of e2fsck.  Designed for use by progress, except for -C 0,
  	which prints a spinning report which may be useful for some users.
  pass5.c (e2fsck_pass5): Use a finer-grained progress reporting scheme
  	(useful for larger filesystems).
  e2fsck.h: Add progress_fd and progress_pos, for use by the Unix
  	progress reporting functions.
1998-05-07 05:02:00 +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 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 24dd4028eb ChangeLog, e2fsck.8.in, unix.c:
unix.c (main): In the case where the filesystem revision is too high,
  	print the message about the superblock possibly being corrupt.
  e2fsck.8.in: Add expanded comments about how the -b option works.
1998-02-01 00:16:40 +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 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 6822754243 ChangeLog, unix.c:
Add a special case check for the error code EROFS and display an
  appropriate error message for this case.
1997-11-04 04:25:22 +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 519149fb45 Many files:
fsck.c:
  chattr.c: Remove #include of getopt.h, since it's not needed.
  tune2fs.c (main):
  lsattr.c (main):
  badblocks.c (main):
  dumpe2fs.c (main):
  mke2fs.c (PRS): Make the variable which getopt returns into be
  	an int, so that it won't lose on platforms where char is
  	unsigned.
ChangeLog, unix.c:
  Make the variable which getopt returns into be an int, so that it
  won't lose on platforms where char is unsigned.
1997-10-25 03:49:49 +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