]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/ext2_mtime_update_on_rename.diff
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / ext2_mtime_update_on_rename.diff
CommitLineData
8f69975d
BS
1From: Jan Kara <jack@suse.cz>
2Subject: [PATCH] ext2: Do not update mtime of a move directory when parent has not changed
3References: bnc#493392
4Patch-mainline: 2.6.30
5
6If the parent of the moved directory has not changed, there's no real
7reason to change mtime. Specs doesn't seem to say anything about this
8particular case and e.g. ext3 does not change mtime in this case.
9So we become a tiny bit more consistent.
10
11Spotted by ronny.pretzsch@dfs.de, initial fix by Jörn Engel <joern@logfs.org>.
12
13Signed-off-by: Jan Kara <jack@suse.cz>
14---
15 fs/ext2/namei.c | 5 ++++-
16 1 file changed, 4 insertions(+), 1 deletion(-)
17
18--- a/fs/ext2/namei.c
19+++ b/fs/ext2/namei.c
20@@ -355,7 +355,10 @@ static int ext2_rename (struct inode * o
21 inode_dec_link_count(old_inode);
22
23 if (dir_de) {
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);
30 }
31 return 0;