]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
tune2fs: explain why an fsck is needed
authorTheodore Ts'o <tytso@mit.edu>
Wed, 23 Aug 2017 14:57:25 +0000 (10:57 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 23 Aug 2017 15:20:01 +0000 (11:20 -0400)
Currently tune2fs just says without any explanation, "run fsck -f".
Add a short explanation that a freshly checked file system is required
to reduce user confusion.  (We could add even more details, but
hopefully this is enough.)

Addresses-Debian-Bug: #857336

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/tune2fs.c
tests/t_dangerous/expect
tests/t_enable_mcsum/expect
tests/t_enable_mcsum_initbg/expect
tests/t_iexpand_mcsum/expect

index 99c17cc47f97399ead6cec8afb99002932275387..3e7ca23e1784dda4a981058575ff7cb2a8100179 100644 (file)
@@ -116,6 +116,8 @@ struct blk_move {
 
 errcode_t ext2fs_run_ext3_journal(ext2_filsys *fs);
 
+static const char *fsck_explain = N_("\nThis operation requires a freshly checked filesystem.\n");
+
 static const char *please_fsck = N_("Please run e2fsck -f on the filesystem.\n");
 static const char *please_dir_fsck =
                N_("Please run e2fsck -fD on the filesystem.\n");
@@ -419,7 +421,8 @@ static void check_fsck_needed(ext2_filsys fs, const char *prompt)
        if (!(fs->super->s_state & EXT2_VALID_FS) ||
            (fs->super->s_state & EXT2_ERROR_FS) ||
            (fs->super->s_lastcheck < fs->super->s_mtime)) {
-               printf("\n%s\n", _(please_fsck));
+               puts(_(fsck_explain));
+               puts(_(please_fsck));
                if (mount_flags & EXT2_MF_READONLY)
                        printf("%s", _("(and reboot afterwards!)\n"));
                exit(1);
@@ -441,7 +444,8 @@ static void request_dir_fsck_afterwards(ext2_filsys fs)
                return;
        fsck_requested++;
        fs->super->s_state &= ~EXT2_VALID_FS;
-       printf("\n%s\n", _(please_dir_fsck));
+       puts(_(fsck_explain));
+       puts(_(please_dir_fsck));
        if (mount_flags & EXT2_MF_READONLY)
                printf("%s", _("(and reboot afterwards!)\n"));
 }
index bae7e0e6e072ca64e77906dbea14b6c5c1830a92..3bae8fafdd1666676cffbfe726f7800c8337ea11 100644 (file)
@@ -11,6 +11,8 @@ Writing superblocks and filesystem accounting information:      \b\b\b\b\bdone
 
 tune2fs -O metadata_csum test.img
 
+This operation requires a freshly checked filesystem.
+
 Please run e2fsck -f on the filesystem.
 
 Exit status is 1
@@ -57,6 +59,8 @@ Exit status is 0
 tune2fs -O metadata_csum test.img
 Enabling checksums could take some time.
 Proceed anyway (or wait 5 seconds) ? (y,N) 
+This operation requires a freshly checked filesystem.
+
 Please run e2fsck -fD on the filesystem.
 
 Exit status is 0
index 5a1a33a50f91c5c834c96496ced9360f91676d53..c8a2674bfaee5c980e9da2ce15163c3fddf98a04 100644 (file)
@@ -18,6 +18,8 @@ Pass 5: Checking group summary information
 Exit status is 0
 tune2fs -O metadata_csum test.img
 
+This operation requires a freshly checked filesystem.
+
 Please run e2fsck -fD on the filesystem.
 
 Exit status is 0
index ed4774c2dfa84e9890efab96a0742415471bc16d..e05dd60318aa6c23c992f3fc29e84390d8e15edd 100644 (file)
@@ -18,6 +18,8 @@ Pass 5: Checking group summary information
 Exit status is 0
 tune2fs -O metadata_csum test.img
 
+This operation requires a freshly checked filesystem.
+
 Please run e2fsck -fD on the filesystem.
 
 Exit status is 0
index 0ebf1626db14a802ea22c7d8dbdf6db1c9aca2bf..772bd623856da10f478ec94c9c13c839d3545c2b 100644 (file)
@@ -19,6 +19,8 @@ Exit status is 0
 tune2fs -I 256 -O metadata_csum test.img
 Setting inode size 256
 
+This operation requires a freshly checked filesystem.
+
 Please run e2fsck -fD on the filesystem.
 
 Exit status is 0