From: Ernesto A. Fernández Date: Tue, 30 Oct 2018 22:06:31 +0000 (-0700) Subject: hfs: update timestamp on truncate() X-Git-Tag: v4.20-rc1~52^2~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8cd3cb5061730af085a3f9890a3352f162b4e20c;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Vyacheslav Dubeyko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index a2dfa1b2a89c7..da243c84e93b0 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c @@ -642,6 +642,8 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr) truncate_setsize(inode, attr->ia_size); hfs_file_truncate(inode); + inode->i_atime = inode->i_mtime = inode->i_ctime = + current_time(inode); } setattr_copy(inode, attr);