+2002-10-31 Theodore Ts'o <tytso@mit.edu>
+
+ * resize2fs.c (inode_scan_and_fix, check_and_change_inodes): When
+ moving an inode, set the ctime field so that people using
+ dump/restore will backup the changed inode. Also update
+ the mtime and ctime of directories which get updated when
+ we need to move an inode.
+
2002-10-30 Theodore Ts'o <tytso@mit.edu>
* Makefile.in (install): Search all compression extensions when
retval = ext2fs_read_inode(rfs->old_fs, ino, &inode);
if (retval) goto errout;
}
+ inode.i_ctime = time(0);
retval = ext2fs_write_inode(rfs->old_fs, new_inode, &inode);
if (retval) goto errout;
int blocksize, char *buf, void *priv_data)
{
struct istruct *is = (struct istruct *) priv_data;
- ext2_ino_t new_inode;
+ struct ext2_inode inode;
+ ext2_ino_t new_inode;
+ errcode_t retval;
if (is->rfs->progress && offset == 0) {
io_channel_flush(is->rfs->old_fs->io);
dirent->inode = new_inode;
+ /* Update the directory mtime and ctime */
+ retval = ext2fs_read_inode(is->rfs->old_fs, dir, &inode);
+ if (retval == 0) {
+ inode.i_mtime = inode.i_ctime = time(0);
+ ext2fs_write_inode(is->rfs->old_fs, dir, &inode);
+ }
+
return DIRENT_CHANGED;
}