+2001-06-01 Theodore Tso <tytso@valinux.com>
+
+ * pass1.c (pass1_get_blocks, pass1_read_inode, pass1_write_inode,
+ pass1_check_directory): Add a safety check to make sure
+ ctx->stashed_inode is non-zero.
+
+ * pass1b.c (pass1b): Use e2fsck_use_inode_shortcuts() to disable
+ the inode shortcut processing, instead of manually
+ clearing only half of the function pointers that needed to
+ be NULL'ed out. This caused nasty bugs if the last inode
+ in the filesystem needed dup block processing.
+
+ * pass1b.c (clone_file_block): When cloning a directory's metadata
+ block, don't try to update the directory block list
+ database, since indirect blocks aren't stored in the
+ database and the resulting error will abort the file clone
+ operation.
+
2001-05-25 Theodore Tso <tytso@valinux.com>
* Release of E2fsprogs 1.20
e2fsck_t ctx = (e2fsck_t) fs->priv_data;
int i;
- if (ino != ctx->stashed_ino)
+ if ((ino != ctx->stashed_ino) || !ctx->stashed_inode)
return EXT2_ET_CALLBACK_NOTHANDLED;
for (i=0; i < EXT2_N_BLOCKS; i++)
{
e2fsck_t ctx = (e2fsck_t) fs->priv_data;
- if (ino != ctx->stashed_ino)
+ if ((ino != ctx->stashed_ino) || !ctx->stashed_inode)
return EXT2_ET_CALLBACK_NOTHANDLED;
*inode = *ctx->stashed_inode;
return 0;
{
e2fsck_t ctx = (e2fsck_t) fs->priv_data;
- if (ino == ctx->stashed_ino)
+ if ((ino == ctx->stashed_ino) && ctx->stashed_inode)
*ctx->stashed_inode = *inode;
return EXT2_ET_CALLBACK_NOTHANDLED;
}
{
e2fsck_t ctx = (e2fsck_t) fs->priv_data;
- if (ino != ctx->stashed_ino)
+ if ((ino != ctx->stashed_ino) || !ctx->stashed_inode)
return EXT2_ET_CALLBACK_NOTHANDLED;
if (!LINUX_S_ISDIR(ctx->stashed_inode->i_mode))
fs->write_inode = 0;
}
}
-
-
}
}
ext2fs_close_inode_scan(scan);
- fs->get_blocks = 0;
- fs->check_directory = 0;
+ e2fsck_use_inode_shortcuts(ctx, 0);
}
static int process_pass1b_block(ext2_filsys fs,
cs->errcode = retval;
return BLOCK_ABORT;
}
- if (cs->dir) {
+ if (cs->dir && (blockcnt >= 0)) {
retval = ext2fs_set_dir_block(fs->dblist,
cs->dir, new_block, blockcnt);
if (retval) {