]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
hfsplus: update timestamps on truncate()
authorErnesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Tue, 30 Oct 2018 22:06:27 +0000 (15:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 31 Oct 2018 15:54:13 +0000 (08:54 -0700)
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>
fs/hfsplus/inode.c

index 8e9427a42b8195e95c77fab60eae4e84e8b51674..d7ab9d8c4b674380f6aa9470910e860dd61cc87a 100644 (file)
@@ -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);