return;
}
- pctx.errcode = ext2fs_write_dir_block3(fs, blk, block, 0);
+ pctx.errcode = ext2fs_write_dir_block4(fs, blk, block, 0,
+ EXT2_ROOT_INO);
if (pctx.errcode) {
- pctx.str = "ext2fs_write_dir_block3";
+ pctx.str = "ext2fs_write_dir_block4";
fix_problem(ctx, PR_3_CREATE_ROOT_ERROR, &pctx);
ctx->flags |= E2F_FLAG_ABORT;
return;
if (retval && !fix)
return 0;
if (!retval) {
- if (ext2fs_test_inode_bitmap2(ctx->inode_dir_map, ino)) {
+ if (ext2fs_check_directory(fs, ino) == 0) {
ctx->lost_and_found = ino;
return ino;
}
return 0;
}
- retval = ext2fs_write_dir_block3(fs, blk, block, 0);
+ retval = ext2fs_write_dir_block4(fs, blk, block, 0, ino);
ext2fs_free_mem(&block);
if (retval) {
pctx.errcode = retval;
errcode_t retval;
struct problem_context pctx;
- if ((dirent->name_len & 0xFF) != 2)
+ if (ext2fs_dirent_name_len(dirent) != 2)
return 0;
if (strncmp(dirent->name, "..", 2))
return 0;
dirent->inode = fp->parent;
if (fp->ctx->fs->super->s_feature_incompat &
EXT2_FEATURE_INCOMPAT_FILETYPE)
- dirent->name_len = (dirent->name_len & 0xFF) |
- (EXT2_FT_DIR << 8);
+ ext2fs_dirent_set_file_type(dirent, EXT2_FT_DIR);
else
- dirent->name_len = dirent->name_len & 0xFF;
+ ext2fs_dirent_set_file_type(dirent, EXT2_FT_UNKNOWN);
fp->done++;
return DIRENT_ABORT | DIRENT_CHANGED;
clear_problem_context(&pctx);
pctx.ino = ino;
+ if (e2fsck_dir_will_be_rehashed(ctx, ino))
+ ctx->fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
retval = ext2fs_dir_iterate(fs, ino, DIRENT_FLAG_INCLUDE_EMPTY,
0, fix_dotdot_proc, &fp);
+ if (e2fsck_dir_will_be_rehashed(ctx, ino))
+ ctx->fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS;
if (retval || !fp.done) {
pctx.errcode = retval;
fix_problem(ctx, retval ? PR_3_FIX_PARENT_ERR :
blk64_t last_block;
errcode_t err;
e2fsck_t ctx;
+ ext2_ino_t dir;
};
static int expand_dir_proc(ext2_filsys fs,
return BLOCK_ABORT;
}
es->num--;
- retval = ext2fs_write_dir_block3(fs, new_blk, block, 0);
+ retval = ext2fs_write_dir_block4(fs, new_blk, block, 0,
+ es->dir);
} else {
retval = ext2fs_get_mem(fs->blocksize, &block);
if (retval) {
es.err = 0;
es.newblocks = 0;
es.ctx = ctx;
+ es.dir = dir;
before = ext2fs_free_blocks_count(fs->super);
retval = ext2fs_block_iterate3(fs, dir, BLOCK_FLAG_APPEND,