From: Theodore Ts'o Date: Sat, 31 Dec 2005 05:52:23 +0000 (-0500) Subject: Add allow_cancellation config option X-Git-Tag: E2FSPROGS-1.39-WIP-1231~13 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=eb065ccf181d49cd1a3709bf607c25d07a6322f1;p=tools%2Fe2fsprogs.git 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" --- diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 9b9b8be..951ff73 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,13 @@ +2005-12-31 Theodore Ts'o + + * 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 * e2fsck.c (e2fsck_free_context), unix.c (PRS), e2fsck.h: Use diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 024e434..bb19727 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)) {