Commit Graph

112 Commits (98eb44bdb5749f323a858d71bf5e7f0eddb61191)

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