lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1239302492-10455-1-git-send-email-jack@suse.cz>
Date:	Thu,  9 Apr 2009 20:41:32 +0200
From:	Jan Kara <jack@...e.cz>
To:	linux-ext4@...r.kernel.org
Cc:	Andrew Morton <akpm@...ux-foundation.org>, Jan Kara <jack@...e.cz>,
	ronny.pretzsch@....de, hare@...e.de
Subject: [PATCH] ext2: Do not update mtime of a move directory when parent has not changed

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@....de, initial fix by Jörn Engel <joern@...fs.org>.

CC: ronny.pretzsch@....de
CC: hare@...e.de
Acked-by: Jörn Engel <joern@...fs.org>
Signed-off-by: Jan Kara <jack@...e.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ