]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ext2: update inode ctime on rename()
authorAndrew Morton <akpm@osdl.org>
Fri, 6 Feb 2004 00:53:35 +0000 (16:53 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 6 Feb 2004 00:53:35 +0000 (16:53 -0800)
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>

Chris Siebenmann posted a fix to update the old inode ctime on rename().

This fix went into 2.2.13, but did not make into 2.4 or 2.6 kernels (the
2.2.13 diff is at the end of this message).

Here is updated 2.6 version without mark_inode_dirty(), which is not
necessary anymore because its called by "ext2_dec_count()" few lines down.

fs/ext2/namei.c

index 879d11fedfba2cd4397c413460b664fc5d01d367..4abd2f06b387a0ba689e71b91adf04140277b282 100644 (file)
@@ -356,6 +356,13 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
                        ext2_inc_count(new_dir);
        }
 
+       /*
+        * Like most other Unix systems, set the ctime for inodes on a
+        * rename.
+        * ext2_dec_count() will mark the inode dirty.
+        */
+       old_inode->i_ctime = CURRENT_TIME;
+
        ext2_delete_entry (old_de, old_page);
        ext2_dec_count(old_inode);