goto skip_new_block;
}
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");
+ ctx->lost_and_found = EXT2_ROOT_INO;
+ return 0;
+ }
if (retval) {
pctx.errcode = retval;
fix_problem(ctx, PR_3_ERR_LPF_NEW_BLOCK, &pctx);
*/
retval = ext2fs_new_inode(fs, EXT2_ROOT_INO, 040700,
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");
+ ctx->lost_and_found = EXT2_ROOT_INO;
+ return 0;
+ }
if (retval) {
pctx.errcode = retval;
fix_problem(ctx, PR_3_ERR_LPF_NEW_INODE, &pctx);
N_("/@l has inline data\n"),
PROMPT_CLEAR, 0 },
+ /* Cannot allocate /lost+found. */
+ { PR_3_LPF_NO_SPACE,
+ N_("Cannot allocate space for /@l.\nPlace lost files in root directory instead"),
+ PROMPT_NULL, 0 },
+
/* Pass 3A Directory Optimization */
/* Pass 3A: Optimizing directories */
/* Lost+found has inline data */
#define PR_3_LPF_INLINE_DATA 0x030018
+/* Cannot allocate lost+found */
+#define PR_3_LPF_NO_SPACE 0x030019
+
/*
* Pass 3a --- rehashing diretories
*/
--- /dev/null
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+/lost+found not found. Create? yes
+
+Cannot allocate space for /lost+found.
+Place lost files in root directory instead? yes
+
+Delete some files and re-run e2fsck.
+
+Pass 3A: Optimizing directories
+Pass 4: Checking reference counts
+Unattached inode 125
+Connect to /lost+found? yes
+
+Inode 125 ref count is 2, should be 1. Fix? yes
+
+Pass 5: Checking group summary information
+Free blocks count wrong for group #0 (496, counted=495).
+Fix? yes
+
+Free blocks count wrong (496, counted=495).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 128/128 files (0.0% non-contiguous), 17/512 blocks
+Exit status is 1
--- /dev/null
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+/lost+found not found. Create? yes
+
+Cannot allocate space for /lost+found.
+Place lost files in root directory instead? yes
+
+Delete some files and re-run e2fsck.
+
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+Block bitmap differences: -9
+Fix? yes
+
+Free blocks count wrong for group #0 (494, counted=495).
+Fix? yes
+
+Free blocks count wrong (494, counted=495).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 128/128 files (0.0% non-contiguous), 17/512 blocks
+Exit status is 1
--- /dev/null
+no space to create lost+found