Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hfsplus: update timestamps on truncate()

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 <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>

authored by

Ernesto A. Fernández and committed by
Linus Torvalds
dc8844aa 1267a07b

+1
+1
fs/hfsplus/inode.c
··· 261 261 } 262 262 truncate_setsize(inode, attr->ia_size); 263 263 hfsplus_file_truncate(inode); 264 + inode->i_mtime = inode->i_ctime = current_time(inode); 264 265 } 265 266 266 267 setattr_copy(inode, attr);