Skip to content

Commit 8cd3cb5

Browse files
eafertorvalds
authored andcommitted
hfs: update timestamp on truncate()
The vfs takes care of updating mtime on ftruncate(), but on truncate() it must be done by the module. Link: http://lkml.kernel.org/r/e1611eda2985b672ed2d8677350b4ad8c2d07e8a.1539316825.git.ernesto.mnd.fernandez@gmail.com Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com> Reviewed-by: Vyacheslav Dubeyko <slava@dubeyko.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent dc8844a commit 8cd3cb5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/hfs/inode.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,8 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr)
642642

643643
truncate_setsize(inode, attr->ia_size);
644644
hfs_file_truncate(inode);
645+
inode->i_atime = inode->i_mtime = inode->i_ctime =
646+
current_time(inode);
645647
}
646648

647649
setattr_copy(inode, attr);

0 commit comments

Comments
 (0)