From 9e81ab3b7d7396810cbe4b2eddb7a86353f2f819 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 5 Feb 2004 16:53:35 -0800 Subject: [PATCH] [PATCH] ext2: update inode ctime on rename() From: Marcelo Tosatti 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index 879d11fedfba2..4abd2f06b387a 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -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); -- 2.53.0