Commit Graph

77 Commits (b0700a1b6083f2f0c19c349f07ca80e70ec456be)

Author SHA1 Message Date
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