RE: ReiserFS patch for updating ctimes of renamed files

From: Alex Adriaanse
Date: Sat Oct 25 2003 - 09:46:59 EST


Hi Hans,

I updated my patch to include Andrew's suggestion of eliminating extra calls
to CURRENT_TIME. I also finally got a chance to test it out, and it seems
to work. After applying this patch, ctime gets updated after a rename, and
GNU tar now backs things up properly. I also could not detect any
filesystem corruption after doing some renames.

Alex

--- fs/reiserfs/namei.c.orig Mon Aug 25 06:44:43 2003
+++ fs/reiserfs/namei.c Fri Oct 24 17:16:33 2003
@@ -1205,8 +1205,11 @@

mark_de_hidden (old_de.de_deh + old_de.de_entry_num);
journal_mark_dirty (&th, old_dir->i_sb, old_de.de_bh);
- old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
- new_dir->i_ctime = new_dir->i_mtime = CURRENT_TIME;
+ ctime = CURRENT_TIME;
+ old_dir->i_ctime = old_dir->i_mtime = ctime;
+ new_dir->i_ctime = new_dir->i_mtime = ctime;
+ old_inode->i_ctime = ctime;
+ reiserfs_update_sd (&th, old_inode);

if (new_dentry_inode) {
// adjust link number of the victim
@@ -1215,7 +1218,6 @@
} else {
new_dentry_inode->i_nlink--;
}
- ctime = CURRENT_TIME;
new_dentry_inode->i_ctime = ctime;
savelink = new_dentry_inode->i_nlink;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/