Commit Graph

281 Commits (7e0136332c072ae4b13788867e7f840baaffe0ab)

Author SHA1 Message Date
Theodore Ts'o cd538080ab e2fsck: If the superblock is corrupt, automatically retry with the backup sb
E2fsck currently only retries with the backup superblock if the
primary superblock is missing (e.g., overwritten with garbage).  If
the superblock is just corrupted enough that it looks like ext2/3/4
superblock, but it is corrupt enough that ext2fs_open2() returns an
error, e2fsck stops without retrying.  Let's fix this oversight.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-09-07 16:54:11 -04:00
Theodore Ts'o e9e9602246 Merge branch 'maint' 2007-08-20 22:58:25 -04:00
Theodore Ts'o 5845caa464 Use sscanf instead of atoi when parsing e2fsck options
atoi() does not check for errors so it shouldn't be used for human
input.  For example, if the user enters the command "e2fsck -C -n" and
forgets that -C requires an argument, the -n will be used as the
argument to -C, and not parsed as an option.  When using sscanf(),
this error case can be detected.

Addresses-Debian-Bug: #435381

Signed-off-by: Bernd Schubert <bs@q-leap.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-20 22:55:33 -04:00
Theodore Ts'o 1a855cb21f Remove e2fsck's -s and -S options to byte-swap ancient PPC filesystems
The need for fixing byte-swapped filesystems is long-gone, and this is
getting in the way of cleaning up e2fsprogs's bitmaps code.  So let's
get rid of it; modern kernels haven't been able to deal with a
byte-swapped filesystem in in about 9 years.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-11 01:58:21 -04:00
Theodore Ts'o aef2283196 Merge branch 'maint' 2007-08-03 23:21:34 -04:00
Theodore Ts'o 9f0288d3bb e2fsck: Allow i_size to be rounded up to the size of a VM page
Allow files to be preallocated on-disk up to the next multiple of the
system's page size without complaining about extra blocks.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-03 20:43:37 -04:00
Theodore Ts'o 6d96b00d57 Add I/O statistics to e2fsck
This patch instruments the libext2fs unix I/O manager and adds bytes
read/written and data rate to e2fsck -tt pass/overall timing output.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-03 20:07:09 -04:00
Theodore Ts'o df36136301 Fix gcc -Wall bug in e2fsck
Remove extraneous return after fatal_error().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-21 13:31:13 -04:00
Kalpak Shah 5107d0d196 Recreate journal that had been removed previously due to corruption
If the journal had been removed because it was corrupt, the
E2F_FLAG_JOURNAL_INODE flag will be set.  If this flag is set, then
recreate the filesystem after checking the filesystem.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2007-06-21 11:59:06 -04:00
Theodore Ts'o 058ad1c70c Don't write changes to the backup superblocks by default
This patch changes ext2fs_open() to set EXT2_FLAG_MASTER_SB_ONLY by
default.  This avoids some problems in e2fsck (reported by Jim Garlick)
where a corrupt journal can end up writing the bad superblock to the
backups.  In general, only e2fsck (after the filesystem is clean),
tune2fs, and resize2fs should change the backup superblocks by default.
Most callers of ext2fs_open() should not be touching anything where the
backups should be touched.  So let's change the defaults to avoid
potential problems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-18 18:26:50 -04:00
Theodore Ts'o d2af1bdd05 Fix e2fsck's get_size logic so it will work with the Linux floppy driver
The Linux floppy driver is a bit different from the other block device
drivers, in that if the device has been opened with O_EXCL, it disallows
another open(), even if the second open() does not have the O_EXCL flag.
So this patch moves the call to ext2fs_get_device_size() so that if it
returns EBUSY, e2fsck can close the filesystem, retry the device size,
and then reopen it.  This rather complicated approach is required since
we need to know the blocksize of the filesystem before we can call
ext2fs_get_device_size().

Addresses Debian Bug: #410569

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-04 01:14:52 -04:00
Brian Behlendorf cae542ce8e [COVERITY] Fix memory leak when parsing extended options in e2fsck
Coverity ID: 35: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2007-03-28 11:28:24 -04:00
Theodore Ts'o a6d8302b48 Use the newer add/remove_error_table com_err interfaces
Change all of the e2fsprogs programs to use the newer add_error_table()
and remove_error_table() interfaces instead of the much older
initialize_*_error_table() function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-12-26 03:38:07 -05:00
Theodore Ts'o 642935c082 Fix misc. gcc -Wall complaints in the misc and e2fsck directories
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-11-14 23:38:17 -05:00
Eric Sandeen f335864338 Add checks to make sure inode counts don't overflow a 32-bit value
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-09-12 14:56:17 -04:00
Eric Sandeen d0ff90d520 Fix signed vs unsigned printf format strings for block and inode numbers
There were still some %d's lurking when we print blocks & inodes; also
many of the counters in the e2fsck_struct were signed, and probably
need to be unsigned to avoid overflows.

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-09-12 14:56:15 -04:00
Matthias Andree abcfdfda7a Read mke2fs.conf and e2fsck.conf from root_sysconfdir rather than harcoded /etc. 2006-06-10 16:08:18 +02:00
Takashi Sato 8deb80a5d1 Fix format statements to make e2fsprogs programs 32-bit clean
Change the format string(%d, %ld) for a block number and inode number
to %u or %lu.

Signed-off-by: Takashi Sato <sho@tnes.nec.co.jp>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-18 21:43:46 -05:00
Theodore Ts'o 2e14e0c8cc Change e2fsck to open non-mounted filesystems in exclusive mode
Thanks to Andreas Dilger for this idea.  If the filesystem is not mounted,
e2fsck will open it in exclusive mode to prevent the a confused/careless 
system administrator from mounting the filesystem while the filesystem 
check is taking place, which could cause all sorts of problems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-18 20:01:09 -05:00
Theodore Ts'o a5f37a9b25 Add a config option which controls whether fs checks are skipped when on battery
Whether fs checks are skipped when the system is running on battery can be
controlled by the new e2fsck.conf option defer_check_on_battery (this option 
defaults to TRUE).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-01-29 05:15:36 -05:00
Theodore Ts'o bc3392c389 Print an explanation when skipping a check due being on battery
On Sat, Jan 28, 2006 at 12:53:33PM -0600, Fredrick Knieper wrote:
> Package: e2fsprogs
> Version: 1.38+1.39-WIP-2005.12.31-1
>
> When running fsck at boot or when running e2fsck manually on a device,
> fsck will not check a filesystem based on the maximum mount count,
> unless a flag such as -f or -c is used to force the filesystem check.

What's happening is that when you run on battery, e2fsck will delay
running the filesystem check, on the assumption that it is better to
defer the check until some time in the future when your laptop is
running on AC mains again.  This deferral is not infinite, however; if
the number of mounts exceeds twice the max mount counts, or if the
interval between checks exceeds twice the check interval, e2fsck will
force the check even though you are on battery.

I've changed the sources to print a message to make this more clear.

Addresses Debian Bug: #350306

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-01-29 05:05:31 -05:00
Theodore Ts'o f5f14fcfe9 Add syntax error reporting to the profile library
E2fsck will now report syntax errors in /etc/e2fsck.conf intead of simply
ignoring the config file when there are errors.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-01-04 10:32:16 -05:00
Theodore Ts'o 5dd2a6e08d Add E2FSCK_CONFIG environment variable
Also, use this environtment variable to make sure that a local
/etc/e2fsck.conf file will not interfere with the regression test
suite.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-31 16:21:00 -05:00
Theodore Ts'o eb065ccf18 Add allow_cancellation config option
If the e2fsck configuration file sets the allow_cancellation option to be 
true, then if the filesystem does not have any known problems, and was 
known to be cleanly unmounted, then let e2fsck exit with a status code of 0 
instead of 32 (FSCK_CANCELED) so that the bootup scripts will continue 
without stopping the boot.  (Addresses Debian Bug: #150295)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-31 00:52:23 -05:00
Theodore Ts'o 1017f65179 Read in /etc/e2fsck.conf configuration file at startup
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-31 00:00:10 -05:00
Theodore Ts'o ae1182cb84 Make e2fsck -cc warn on a read-only root filesystem
Don't let the user run e2fsck -ccn on the root partition, without warning 
that he or she might be doing something Really Stupid.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-09 18:11:16 -05:00
Theodore Ts'o f4b6d2a039 Fix typo in e2fsck error message.
Thanks to Solar Designer for pointing out the missing preposition.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-09 17:31:08 -05:00
Theodore Ts'o 8dceb92407 E2fsck: fix future times in the superblock's last mount or last write fields
Detect if the superblock's last mount field or last write field is in
the future, and offer to fix if so.  (Addresses Debian Bug #327580)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-24 21:59:45 -04:00
Theodore Ts'o b28a6e96af Fix use-after-free bug of e2fsck context structure.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-07-25 11:36:43 -05:00
Theodore Ts'o bb145b01cf Fix e2fsprogs messages for grammar and consistency, based on suggestions
from Benno Schulenberg.

Add missing _() so all strings can be internationalized.
2005-06-20 08:35:27 -04:00
Theodore Ts'o 1f3ad14a5a Use a centrally stored current time for "now" which
can be overridden using the E2FSCK_TIME environment 
variable, for better reproducibility for regression tests.
2005-04-14 14:07:53 -04:00
Theodore Ts'o 550a4afa24 E2fsck will now check the individual block group inode and block free counts,
as well as the filesystem-wide inode and block free counts.  If any of the
free counts is too large, force a full filesystem check.  (Addresses 
Debian Bug #291571)
2005-01-25 03:09:24 -05:00
Theodore Ts'o 9214dccbfb Miscellaneous gcc -Wall cleanups. Use fixed rather than floating point
math to avoid rounding issues.
2005-01-19 13:57:40 -05:00
Theodore Ts'o ecd0d8fe2a Clean up Matthais's "fix crash when /proc/acpi/ac_acapter is not present"
patch.
2005-01-17 13:59:18 -05:00
Matthias Andree 4b13704cbe Fix crash when /proc/acpi/ac_adapter/ is not present, for instance,
on pre-ACPI and non-Linux systems.
2005-01-13 03:35:29 +01:00
Theodore Ts'o 2e8ca9a26b Add support for passing options to the io layer using the URL syntax. For
example, /tmp/test.img?offset=1024.  Multiple options can separated using
the & character, although at the moment the only option implemented is
the offset option in the unix_io layer.
2004-11-30 14:07:11 -05:00
Theodore Ts'o 66fbee8cbb unix.c (check_if_skip): If the checkinterval is zero, then
disregard it when calculating when the next check will
	take place by e2fsck.
2004-05-04 20:38:17 -04:00
Theodore Ts'o c07f9f2639 In e2fsck, when trying to determine if the system is running on
battery, be more flexible about the name of the ACPI device that
corresponds to the AC adapter.  (Addresses Debian bug #242136)
2004-04-12 00:16:44 -04:00
Theodore Ts'o bc69f82db8 Add missing break statement so e2fsck -k actually works.
(Addresses Debian Bug #234993)
2004-02-27 10:39:27 -05:00
Theodore Ts'o 4fb9d52ba6 unix.c (main, PRS), e2fsck.8.in: Add a new -k option which keeps
the existing badblocks list when using the -c option.
	(Addresses Debian bug #229103)
2004-02-24 00:16:09 -05:00
Theodore Ts'o 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o 3ddf2f662e When testing a disk using e2fsck -c, use the list
of new bad blocks to replace the current list of bad
blocks.  This way "e2fsck -c" can be used to recover from
a corrupted bad block inode.
2003-12-02 07:56:42 -05:00
Theodore Ts'o 015b03df7d In e2fsck, given an extra grace period before actually forcing
a filesystem check if a laptop system reports it is running on
battery.  This way the laptop will be biased to waiting until
it is on AC power before doing a filesystem check.  (Addresses
Debian bug #205177)
2003-11-21 11:02:22 -05:00
Theodore Ts'o 6de289cb10 In e2fsck, if the number of mounts until the next forced filesystem
check is 5 or less, mention this to the user.  (Addresses 
Debian bug #157194)
2003-11-21 10:54:54 -05:00
Theodore Ts'o 817e49e3ce Check the returned name from blkid_get_devname in tune2fs and
e2fsck, and print an error if the requested LABEL/UUID does 
not exist (previously, we core dumped!)
2003-11-21 09:10:29 -05:00
Theodore Ts'o 54a31a3b2e e2fsck.h, unix.c (PRS, e2fsck_clear_progbar,
e2fsck_simple_progress): Don't print the ^A and ^B
	characters which bracket the progress bar when the e2fsck
	program is talking directly to a tty, but only when it is
	being piped to another program.  (Addresses Debian bug
	#204137)
unix.c: Move some initialized variables to the BSS segment to 
	shrink the size of the e2fsck executable.
2003-08-19 10:08:34 -04:00
Theodore Ts'o 113e405bb6 unix.c (show_stats), e2fsck.h: Use ngettext (abbreivated with
the macro P_(str1, str2, n)) to simplify the statistics
	reporting.
2003-05-17 21:00:46 -04:00
Theodore Ts'o 2a29f1354f Add --enable-test-io-debug configure option which causes e2fsck and
tune2fs to use the test I/O manager.

The test I/O manager has been changed to not do anything extra by 
default, unless the TEST_IO_FLAGS and/or TEST_IO_BLOCK environment
variables are set, which controls what I/O operations are logged and
a block number to watch, respectively.  The log messages are sent to
stderr by default, unless a filename is specified via the 
TEST_IO_LOGFILE environment variable.
2003-05-05 12:08:47 -04:00
Theodore Ts'o ddc32a045b Add Czech translation.
Remove "NYC" translation.  Add Czech translation from Miloslav 
Trmac <mitr@volny.cz>

Random NLS and other display fixes from Miloslav.
2003-05-03 18:45:55 -04:00
Theodore Ts'o 520ead378e Fix gcc -Wall warnings. 2003-04-19 13:48:27 -04:00
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