From: Jan Kara <jack@suse.cz>
To: linux-ext4@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jan Kara <jack@suse.cz>,
ronny.pretzsch@dfs.de, hare@suse.de
Subject: [PATCH] ext2: Do not update mtime of a move directory when parent has not changed
Date: Thu, 9 Apr 2009 20:41:32 +0200 [thread overview]
Message-ID: <1239302492-10455-1-git-send-email-jack@suse.cz> (raw)
If the parent of the moved directory has not changed, there's no real
reason to change mtime. Specs doesn't seem to say anything about this
particular case and e.g. ext3 does not change mtime in this case.
So we become a tiny bit more consistent.
Spotted by ronny.pretzsch@dfs.de, initial fix by Jörn Engel <joern@logfs.org>.
CC: ronny.pretzsch@dfs.de
CC: hare@suse.de
Acked-by: Jörn Engel <joern@logfs.org>
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ext2/namei.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index 90ea179..556f258 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -352,7 +352,10 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
inode_dec_link_count(old_inode);
if (dir_de) {
- ext2_set_link(old_inode, dir_de, dir_page, new_dir);
+ /* Set link only if parent has changed and thus avoid setting
+ * of mtime of the moved directory on a pure rename. */
+ if (old_dir != new_dir)
+ ext2_set_link(old_inode, dir_de, dir_page, new_dir);
inode_dec_link_count(old_dir);
}
return 0;
--
1.6.0.2
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2009-04-09 18:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-09 18:41 Jan Kara [this message]
2009-04-09 18:51 ` [PATCH] ext2: Do not update mtime of a move directory when parent has not changed Andrew Morton
2009-04-09 19:15 ` Jan Kara
2009-04-09 20:20 ` Andrew Morton
2009-04-10 14:13 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1239302492-10455-1-git-send-email-jack@suse.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=hare@suse.de \
--cc=linux-ext4@vger.kernel.org \
--cc=ronny.pretzsch@dfs.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox