cifs: update ctime and mtime during truncate
commitbf9b3fbe5fc1c69e0103b6c78bf07f7164327d26
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Sat, 20 Jun 2020 02:51:29 +0000 (19 22:51 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:10:44 +0000 (22 09:10 +0200)
tree3d1c0bc6a52965087339c782f5c1d845229fdf8e
parent5e68e0905a2d768d1d091e6745aa9399b16c4ba0
cifs: update ctime and mtime during truncate

[ Upstream commit 5618303d8516f8ac5ecfe53ee8e8bc9a40eaf066 ]

As the man description of the truncate, if the size changed,
then the st_ctime and st_mtime fields should be updated. But
in cifs, we doesn't do it.

It lead the xfstests generic/313 failed.

So, add the ATTR_MTIME|ATTR_CTIME flags on attrs when change
the file size

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/inode.c