Commit Graph

281 Commits (7e0136332c072ae4b13788867e7f840baaffe0ab)

Author SHA1 Message Date
Theodore Ts'o 908b785c3f Use setvbuf instead of setbuf to force stdout and
stderr to be non-buffered when the stdout/stderr are a pipe.
This fixes a cosmetic problem when using e2fsck under logsave.
2003-04-16 15:20:13 -04:00
Theodore Ts'o bc34d6be65 * Add support for the -a and -s options to logsave.
* Change e2fsck to bracket its progress bar output with ctrl-A and ctrl-B 
    characters, so that logsave -s can omit writing the progress bar output
    to the log file.
2003-04-16 14:05:06 -04:00
Theodore Ts'o fff45483ed Add portability enhancements for Cygwin32 environment. 2003-04-13 00:44:19 -04:00
Theodore Ts'o e71d87317a Add Apple/Darwin patches. 2003-03-14 02:13:48 -05:00
Theodore Ts'o b0700a1b60 Change e2fsck to detect and offer to delete or rename duplicate
filenames in directories when rebuilding directories using
"e2fsck -fD /dev/XXX"
2003-03-14 01:43:56 -05:00
Theodore Ts'o f364093b19 Update debugfs and e2fsck to use the blkid library. 2003-03-01 19:47:44 -05:00
Theodore Ts'o 19445ef970 Fixed up minor documentation issues (man page for badblocks and usage
message for e2fsck).
2003-01-29 21:04:52 -05:00
Theodore Ts'o b92ae1535c Detect if there is an attempt to run the journal twice, and
abort the e2fsck run with an error if this is the case.
(Address IBM Bugzilla bug #1226)
2003-01-02 16:53:54 -05:00
Theodore Ts'o 8161a7484f Print an error if more than one of the -p/-a, -n or -y options
are passed to e2fsck.
2003-01-02 16:36:44 -05:00
Theodore Ts'o c1637bd371 unix.c (main): Fix a bug where e2fsck could erroneously mark a
filesystem as being valid if it was being checked and it
	is interrupted with a ^C.  (Bug introduced in e2fsprogs
	1.28.)
2002-11-08 15:55:17 -05:00
Theodore Ts'o 5e72cdbeb9 unix.c (PRS), journal.c: Set the default level of journal
debugging to be 0, and allow the user to set the level of
	journal debugging by using the E2FSCK_JBD_DEBUG
	environment variable.
2002-11-08 15:35:13 -05:00
Theodore Ts'o ee895139d7 e2fsck.h, unix.c (main, check_mount): Fix e2fsck so that it
returns the appropriate exit code, so that the boot
	scripts will be told that they need to automatically
	reboot.
2002-11-07 16:16:55 -05:00
Theodore Ts'o 4fd6834c68 unix.c (usage), e2fsck.8.in: Add the -D option to the usage and
command synopsis.  (Addresses Debian bug #167108)
(missed this file in the previous checkin)
2002-10-31 19:39:03 -05:00
Theodore Ts'o 3e69906495 Fix gcc -Wall nits.
Fix format bug if NLS is in use.

Add extra so that the info directory looks OK on OpenWall.
2002-10-13 23:56:28 -04:00
Theodore Ts'o e70ae99e07 Add a more sophisticated algorithm to e2fsck to salvage corrupted
directories.

Speed up e2fsck slightly by only updating the master superblock;
there is no point to update the backup superblocks.

Fix a small bug in the rehashing code which could leave the indexed
flag set even after the directory was compressed instead of indexed.
(Not fatal, since the kernel will deal with this, but technically
it filesystem isn't consistent, and the filesystem will be marked
as being in error when the kernel comes across the directory.  It
should also never happen in real life, since directories that small
will never be indexed, but better safe than sorry.)

Also change the threshold of when directories are indexed, so that
directories of size 2 blocks will be indexed.  Otherwise they will
never be indexed by the kernel when they grow.
2002-09-28 09:16:28 -04:00
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 8fdc9985c1 Add initial support for htree directories. 2002-06-25 23:26:34 -04:00
Andreas Dilger 932a489cdf Add support for creating and checking 8192-byte blocksize filesystems.
We complain if you try to create such a filesystem on a system with 4096
byte PAGE_SIZE.

Add checks for valid inode size for undocumented -I option.
2002-05-16 03:20:07 -06:00
Theodore Ts'o f2d5c93703 Fixed the journal handling so that an offer is made to clear the
journal filesystem in all cases.

Fixed a bug in e2fsck which caused it to give spurious I/O manager
bad messages right before crashes.
2002-03-07 03:13:07 -05:00
Theodore Ts'o 14308a5398 Newer libintl needs LC_CTYPE to be set in addition to LC_MESSAGES. 2002-03-05 03:26:52 -05:00
Theodore Ts'o 3ed57c27df In mke2fs and e2fsck, specifying the -c option twice will now do
a read/write test on the disk.  Update the man pages to encourage
using the -c option, and to discouraging running badblocks separately,
since users tend to forget to set the blocksize when running 
badblocks.
2001-12-24 15:01:59 -05:00
Theodore Ts'o f1a1761d67 Enhnaced the get backup superblock function so that it does
the right thing if the filesystem superblock is unavailable; 
it will search for the superblock by iterating over possible
blocksizes.
2001-12-23 22:27:52 -05:00
Theodore Ts'o d37066a9fa Give the opportunity for e2fsck to run the journal even if
recovery flag is cleared.  If we're using a backup
superblock, run the journal by default.
2001-12-21 23:28:54 -05:00
Theodore Ts'o 4ea7bd0439 Fix various gcc -Wall nits. Fixed a bug in mke2fs where a bogus
error message could be printed on an malloc() failure, and e2image
was optimized to avoid needless system calls by using the stashed
inode functions.
2001-12-16 23:23:37 -05:00
Theodore Ts'o ae6cdcf74a e2fsck: If a superblock is specified explicitly by the
user, don't try to automatically fall back to an
	alternate superblock.
2001-09-19 15:17:25 -04:00
Theodore Ts'o 0f8973fb09 Remove EXT2FS_VERSION from the version display, since it
only confuses people.

Make fsck's version display be consistent with the other e2fsprogs
programs.
2001-08-27 12:44:23 -04:00
Theodore Ts'o 2b94c658c7 unix.c (show_stats): Print the number of large files in verbose mode. 2001-08-09 04:08:52 -04:00
Theodore Ts'o 83e6ac84c7 unix.c (check_mount): Remove the code in e2fsck which tested for the
root filesystem being mounted read-only, and depend on the
	results flags from ext2fs_check_if_mounted.
2001-07-30 16:29:52 -04:00
Theodore Ts'o 0628ae3948 unix.c (main): Move the final print_resource_track call after
the filesystem and context handle are closed
2001-07-29 12:26:46 -04:00
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 d312401961 unix.c (main): Add an explicit warning when the filesystem is left not
completely fixed when e2fsck exits.  (Addresses Debian bug #104502.)
2001-07-20 14:13:49 -04:00
Theodore Ts'o 636a954a30 Use long long to calculate the percentage
of the number of blocks in use in the filesystem.
2001-06-29 17:57:26 -04:00
Theodore Ts'o b6a0807b08 ChangeLog, unix.c:
unix.c (check_if_skip): Adapted patch from Andreas Dilger which prints
  	the number of mounts or days elapsed since the last check when e2fsck
  	is forced to check an otherwise clean filesystem.
2001-06-14 01:16:17 +00:00
Theodore Ts'o 5df55d7f84 ChangeLog, Makefile.in, swapfs.c, unix.c:
Makefile.in: Add message.c and swapfs.c to the list of source files to
  	build the make depend.
  swapfs.c, unix.c: Only support the -s and -S options to e2fsck if
  	ENABLE_SWAPFS is defined.
Many files:
  ext2fs.h, bitops.h, block.c, bmap.c, closefs.c, dirblock.c, inode.c,
  	native.c, openfs.c, rw_bitmaps.c, swapfs.c: Only include the
  	byte-swapping logic if ENABLE_SWAPFS is turned on or if we're on a
  	big-endian machine.
  initialize.c (ext2fs_initialize):Use WORDS_BIGENDIAN directly to set
  	EXT2_FLAG_SWAP_BYTES, instead of using ext2fs_native_flag.
  native.c (ext2fs_native_flag): Use WORDS_BIGENDIAN provided by
  	autoconf to determine whether or not return EXT2_FLAG_SWAP_BYTES.
2001-06-11 07:00:04 +00:00
Theodore Ts'o fc9a69ca37 ChangeLog, unix.c:
unix.c (PRS): Skip validation of -C's file descriptor if it is zero,
  	since that is special case.
2001-05-12 13:43:46 +00:00
Theodore Ts'o ae8160e692 ChangeLog, unix.c:
unix.c (PRS): Validate the completion information file descriptor so
  	that the completion bar won't get accidentally written onto the disk.
2001-05-01 21:13:37 +00:00
Theodore Ts'o bc57f15390 ChangeLog, unix.c:
unix.c (check_if_skip): If the max_mount_count is zero, treat it as
  	having no count set.
2001-04-26 04:11:46 +00:00
Theodore Ts'o 5ba23cb149 ChangeLog, e2fsck.h, flushb.c, iscan.c, unix.c:
iscan.c, unix.c, e2fsck.h: Don't use NOARGS, and use
  	ext2fs_sync_device() instead of using BLKFLSBUF.
  flushb.c: Don't use NOARGS anymore; everything is STDC these days.
ChangeLog, pass1.c:
  pass1.c (process_block): Remove dead code which was never getting
  	executed.
2001-01-11 19:15:02 +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 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 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 2575fb0443 ChangeLog, unix.c:
unix.c (main): If we're doing a read-only check, skip the journal
  	playback, but don't abort the e2fsck run.
2000-08-22 21:50:04 +00:00
Theodore Ts'o 243dc31f48 ChangeLog, unix.c:
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 e2fsck_global_ctx and let it
  	be exported globally.
2000-08-22 21:37:47 +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 b8d164cd24 ChangeLog, unix.c:
unix.c (calc_percent): Make sure that we don't take a floating
  	exception if the max value is zero.  (should normally never happen,
  	but...)
2000-08-08 03:17:04 +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
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