ufs: don't touch mtime/ctime of directory being moved
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Jun 2015 05:56:23 +0000 (01:56 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Jun 2015 06:08:34 +0000 (02:08 -0400)
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>
fs/ufs/dir.c
fs/ufs/namei.c
fs/ufs/ufs.h

index 1bfe8ca..862d284 100644 (file)
@@ -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);
 }
 
diff --cc fs/ufs/namei.c
Simple merge
diff --cc fs/ufs/ufs.h
Simple merge