From: Ernesto A. Fernández Date: Tue, 30 Oct 2018 22:06:27 +0000 (-0700) Subject: hfsplus: update timestamps on truncate() X-Git-Tag: v4.19.87~123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0013adceb5211fce175c0bd30b4ebc81c265d97f;p=thirdparty%2Fkernel%2Fstable.git hfsplus: update timestamps on truncate() [ Upstream commit dc8844aada735890a6de109bef327f5df36a982e ] The vfs takes care of updating ctime and mtime on ftruncate(), but on truncate() it must be done by the module. This patch can be tested with xfstests generic/313. Link: http://lkml.kernel.org/r/9beb0913eea37288599e8e1b7cec8768fb52d1b8.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 Signed-off-by: Sasha Levin --- diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 8e9427a42b819..d7ab9d8c4b674 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -261,6 +261,7 @@ static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr) } truncate_setsize(inode, attr->ia_size); hfsplus_file_truncate(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); } setattr_copy(inode, attr);