summaryrefslogtreecommitdiff
path: root/fs/ufs/dir.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-06-16 01:56:23 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-06-16 02:08:34 -0400
commit70d45cdb664390a5573c05f1eecc8432dcc6581b (patch)
tree6ab7b1d46459aa7c872a156d36ffc6416e8c9464 /fs/ufs/dir.c
parenta50e4a02ad6957ef6f77cccaa8ef6a337f1856af (diff)
ufs: don't touch mtime/ctime of directory being moved
See "ext2: Do not update mtime of a moved directory" (and followup in "ext2: fix unbalanced kmap()/kunmap()") for background; this is UFS equivalent - the same problem exists here. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs/dir.c')
-rw-r--r--fs/ufs/dir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
index 1bfe8cabff0f..862d284d438e 100644
--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -87,7 +87,8 @@ ino_t ufs_inode_by_name(struct inode *dir, const struct qstr *qstr)
/* Releases the page */
void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
- struct page *page, struct inode *inode)
+ struct page *page, struct inode *inode,
+ bool update_times)
{
loff_t pos = page_offset(page) +
(char *) de - (char *) page_address(page);
@@ -103,7 +104,8 @@ void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
err = ufs_commit_chunk(page, pos, len);
ufs_put_page(page);
- dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
+ if (update_times)
+ dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
mark_inode_dirty(dir);
}