1 From: Jan Kara <jack@suse.cz>
2 Subject: [PATCH] ext2: Do not update mtime of a move directory when parent has not changed
6 If the parent of the moved directory has not changed, there's no real
7 reason to change mtime. Specs doesn't seem to say anything about this
8 particular case and e.g. ext3 does not change mtime in this case.
9 So we become a tiny bit more consistent.
11 Spotted by ronny.pretzsch@dfs.de, initial fix by Jörn Engel <joern@logfs.org>.
13 Signed-off-by: Jan Kara <jack@suse.cz>
15 fs/ext2/namei.c | 5 ++++-
16 1 file changed, 4 insertions(+), 1 deletion(-)
20 @@ -355,7 +355,10 @@ static int ext2_rename (struct inode * o
21 inode_dec_link_count(old_inode);
24 - ext2_set_link(old_inode, dir_de, dir_page, new_dir);
25 + /* Set link only if parent has changed and thus avoid setting
26 + * of mtime of the moved directory on a pure rename. */
27 + if (old_dir != new_dir)
28 + ext2_set_link(old_inode, dir_de, dir_page, new_dir);
29 inode_dec_link_count(old_dir);