[PATCH] fs/open.c: update {m,c}time for truncate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux