Just like what we do for ftruncate. (Why not) Without this patch, cifs, sometimes NFS, fail to update timestamps after truncate call. Signed-off-by: Murphy Zhou <jencce.kernel@xxxxxxxxx> --- fs/open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/open.c b/fs/open.c index a59abe3c669a..f247085aaee4 100644 --- a/fs/open.c +++ b/fs/open.c @@ -107,7 +107,8 @@ long vfs_truncate(const struct path *path, loff_t length) if (!error) error = security_path_truncate(path); if (!error) - error = do_truncate(path->dentry, length, 0, NULL); + error = do_truncate(path->dentry, length, + ATTR_MTIME|ATTR_CTIME, NULL); put_write_and_out: put_write_access(inode); -- 2.21.0