summaryrefslogtreecommitdiff
path: root/fs/hfs
diff options
context:
space:
mode:
authorErnesto A. Fernández <ernesto.mnd.fernandez@gmail.com>2018-10-30 15:06:31 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-28 18:28:50 +0100
commit79fb2b86db4551097e4a004d623b04cc1aaac1cf (patch)
treee9436d1095528b8ea72b0a05db7bd03950822f7a /fs/hfs
parent304d969f63ef401c46699d7d0851c4e5441676ba (diff)
hfs: update timestamp on truncate()
[ Upstream commit 8cd3cb5061730af085a3f9890a3352f162b4e20c ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/hfs')
-rw-r--r--fs/hfs/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index f776acf2378a..de0d6d4c46b6 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -641,6 +641,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);