]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: convert 'delete files' warning to a proper fix_problem error
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 10 Aug 2014 22:21:15 +0000 (18:21 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 10 Aug 2014 22:21:15 +0000 (18:21 -0400)
In pass 3, convert the "delete files and re-run e2fsck" message to a
proper error code for more consistent error reporting and to make
translation easier.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass3.c
e2fsck/problem.c
e2fsck/problem.h
tests/f_nospc_create_lnf/expect.1
tests/f_nospc_create_lnf/expect.2

index 0b02961361b33297f3c3132fe0128ef9330b5ade..63b1d7016c0be87e568764fc3286d3c92696971f 100644 (file)
@@ -452,7 +452,7 @@ unlink:
        retval = ext2fs_new_block2(fs, 0, ctx->block_found_map, &blk);
        if (retval == EXT2_ET_BLOCK_ALLOC_FAIL &&
            fix_problem(ctx, PR_3_LPF_NO_SPACE, &pctx)) {
-               printf("Delete some files and re-run e2fsck.\n\n");
+               fix_problem(ctx, PR_3_NO_SPACE_TO_RECOVER, &pctx);
                ctx->lost_and_found = EXT2_ROOT_INO;
                return 0;
        }
@@ -472,7 +472,7 @@ skip_new_block:
                                  ctx->inode_used_map, &ino);
        if (retval == EXT2_ET_INODE_ALLOC_FAIL &&
            fix_problem(ctx, PR_3_LPF_NO_SPACE, &pctx)) {
-               printf("Delete some files and re-run e2fsck.\n\n");
+               fix_problem(ctx, PR_3_NO_SPACE_TO_RECOVER, &pctx);
                ctx->lost_and_found = EXT2_ROOT_INO;
                return 0;
        }
index 452137ac810257940016b97e0f7a6a3200ac51d7..2d29c35d9a38fb5e277058ae780f198b44a9db44 100644 (file)
@@ -1619,6 +1619,11 @@ static struct e2fsck_problem problem_table[] = {
          N_("Cannot allocate space for /@l.\nPlace lost files in root directory instead"),
          PROMPT_NULL, 0 },
 
+       /* Delete some files and re-run e2fsck. */
+       { PR_3_NO_SPACE_TO_RECOVER,
+         N_("Insufficient space to recover lost files!\nMove data off the @f and re-run e2fsck.\n\n"),
+         PROMPT_NONE, 0 },
+
        /* Pass 3A Directory Optimization       */
 
        /* Pass 3A: Optimizing directories */
index 72cfc4d5b5e8e5f0fb35bbccd0945a1caca4abe5..89146ecda0596ba324a6106ae04116ae56362d06 100644 (file)
@@ -967,6 +967,9 @@ struct problem_context {
 /* Cannot allocate lost+found */
 #define PR_3_LPF_NO_SPACE              0x030019
 
+/* Insufficient space to recover lost files */
+#define PR_3_NO_SPACE_TO_RECOVER       0x03001A
+
 /*
  * Pass 3a --- rehashing diretories
  */
index fc20628f043460ce57c44069da3c26f4b07b7592..986fe12f81767087706152a860e76160614deab6 100644 (file)
@@ -6,7 +6,8 @@ Pass 3: Checking directory connectivity
 Cannot allocate space for /lost+found.
 Place lost files in root directory instead? yes
 
-Delete some files and re-run e2fsck.
+Insufficient space to recover lost files!
+Move data off the filesystem and re-run e2fsck.
 
 Pass 3A: Optimizing directories
 Pass 4: Checking reference counts
index 5a446495c33e84abb1932a7a69b65300525781fd..e9757f842fb90647fd9bc04959718f008907cab4 100644 (file)
@@ -6,7 +6,8 @@ Pass 3: Checking directory connectivity
 Cannot allocate space for /lost+found.
 Place lost files in root directory instead? yes
 
-Delete some files and re-run e2fsck.
+Insufficient space to recover lost files!
+Move data off the filesystem and re-run e2fsck.
 
 Pass 4: Checking reference counts
 Pass 5: Checking group summary information