};
/* Used by the region allocation code */
-typedef __u32 region_addr_t;
+typedef __u64 region_addr_t;
typedef struct region_struct *region_t;
#ifndef HAVE_STRNLEN
ext2fs_block_bitmap fs_meta_blocks;
e2fsck_t ctx;
blk64_t bad_ref;
+ region_t region;
};
struct process_inode_block {
(1 << (21 - ctx->fs->super->s_log_block_size))))
problem = PR_1_TOOBIG_DIR;
+ if (is_leaf && problem == 0 && extent.e_len > 0 &&
+ region_allocate(pb->region, extent.e_lblk, extent.e_len))
+ problem = PR_1_EXTENT_COLLISION;
+
/*
* Uninitialized blocks in a directory? Clear the flag and
* we'll interpret the blocks later.
ctx->extent_depth_count[info.max_depth]++;
}
+ pb->region = region_create(0, info.max_lblk);
+ if (!pb->region) {
+ ext2fs_extent_free(ehandle);
+ fix_problem(ctx, PR_1_EXTENT_ALLOC_REGION_ABORT, pctx);
+ ctx->flags |= E2F_FLAG_ABORT;
+ return;
+ }
+
eof_lblk = ((EXT2_I_SIZE(inode) + fs->blocksize - 1) >>
EXT2_BLOCK_SIZE_BITS(fs->super)) - 1;
scan_extent_node(ctx, pctx, pb, 0, 0, eof_lblk, ehandle, 1);
"check_blocks_extents");
pctx->errcode = 0;
}
+ region_free(pb->region);
+ pb->region = NULL;
ext2fs_extent_free(ehandle);
}
/* Error allocating EA region allocation structure */
{ PR_1_EA_ALLOC_REGION_ABORT,
- N_("@A @a @b %b. "),
+ N_("@A @a region allocation structure. "),
PROMPT_NONE, PR_FATAL},
/* Error EA allocation collision */
N_("Bad block list says the bad block list @i is bad. "),
PROMPT_CLEAR_INODE, 0 },
+ /* Error allocating extent region allocation structure */
+ { PR_1_EXTENT_ALLOC_REGION_ABORT,
+ N_("@A @x region allocation structure. "),
+ PROMPT_NONE, PR_FATAL},
+
+ /* Inode has a duplicate extent mapping */
+ { PR_1_EXTENT_COLLISION,
+ N_("@i %i has a duplicate @x mapping\n\t(logical @b %c, @n physical @b %b, len %N)\n"),
+ PROMPT_CLEAR, 0 },
+
/* Pass 1b errors */
/* Pass 1B: Rescan for duplicate/bad blocks */
/* badblocks is in badblocks */
#define PR_1_BADBLOCKS_IN_BADBLOCKS 0x01007B
+/* can't allocate extent region */
+#define PR_1_EXTENT_ALLOC_REGION_ABORT 0x01007C
+
+/* leaf extent collision */
+#define PR_1_EXTENT_COLLISION 0x01007D
+
/*
* Pass 1b errors
*/
Inode 13 missing EXTENT_FL, but is in extents format
Fix? yes
+Inode 16 has a duplicate extent mapping
+ (logical block 3, invalid physical block 4613, len 2)
+Clear? yes
+
+Inode 16, i_blocks is 16, should be 12. Fix? yes
+
Inode 17 has an invalid extent
(logical block 0, invalid physical block 22011707397135, len 15)
Clear? yes
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
-Block bitmap differences: -1081 +4611 -(5121--5142)
+Block bitmap differences: -1081 +4611 -(4613--4614) -(5121--5142)
Fix? yes
-Free blocks count wrong for group #0 (7081, counted=7098).
+Free blocks count wrong for group #0 (7081, counted=7100).
Fix? yes
-Free blocks count wrong (7081, counted=7098).
+Free blocks count wrong (7081, counted=7100).
Fix? yes
Inode bitmap differences: -18
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
-test_filesys: 18/256 files (0.0% non-contiguous), 1094/8192 blocks
+test_filesys: 18/256 files (5.6% non-contiguous), 1092/8192 blocks
Exit status is 1
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
-test_filesys: 18/256 files (0.0% non-contiguous), 1094/8192 blocks
+test_filesys: 18/256 files (5.6% non-contiguous), 1092/8192 blocks
Exit status is 0