diff options
author | Theodore Ts'o <tytso@mit.edu> | 2005-12-31 00:52:23 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2005-12-31 00:52:23 -0500 |
commit | eb065ccf181d49cd1a3709bf607c25d07a6322f1 (patch) | |
tree | 84ecd0e049421a5c93bf9fc80f4185556f37814e | |
parent | 1017f65179f4aa313f699109b471b79f99f38d3d (diff) | |
download | e2fsprogs-eb065ccf181d49cd1a3709bf607c25d07a6322f1.tar.gz |
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>
-rw-r--r-- | e2fsck/ChangeLog | 10 | ||||
-rw-r--r-- | e2fsck/unix.c | 17 |
2 files changed, 24 insertions, 3 deletions
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 9b9b8be5..951ff73f 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,13 @@ +2005-12-31 Theodore Ts'o <tytso@mit.edu> + + * unix.c (main): 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) + 2005-12-30 Theodore Ts'o <tytso@mit.edu> * e2fsck.c (e2fsck_free_context), unix.c (PRS), e2fsck.h: Use diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 024e4342..bb197276 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1147,15 +1147,26 @@ restart: exit_value |= FSCK_REBOOT; } } - if (!ext2fs_test_valid(fs)) { + if (!ext2fs_test_valid(fs) || + ((exit_value & FSCK_CANCELED) && + (sb->s_state & EXT2_ERROR_FS))) { printf(_("\n%s: ********** WARNING: Filesystem still has " "errors **********\n\n"), ctx->device_name); exit_value |= FSCK_UNCORRECTED; exit_value &= ~FSCK_NONDESTRUCT; } - if (exit_value & FSCK_CANCELED) + if (exit_value & FSCK_CANCELED) { + int allow_cancellation; + + profile_get_boolean(ctx->profile, "options", + "allow_cancellation", 0, 0, + &allow_cancellation); exit_value &= ~FSCK_NONDESTRUCT; - else { + if (allow_cancellation && ext2fs_test_valid(fs) && + (sb->s_state & EXT2_VALID_FS) && + !(sb->s_state & EXT2_ERROR_FS)) + exit_value = 0; + } else { show_stats(ctx); if (!(ctx->options & E2F_OPT_READONLY)) { if (ext2fs_test_valid(fs)) { |