diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-09-28 11:46:01 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-10-10 01:20:54 +0200 |
commit | 345a6b2ee2987a11bc8e9c08ff2b68a973fd912c (patch) | |
tree | def00cd7f149c5882242571c9b2e5be64415aa4c /fs/f2fs/file.c | |
parent | f2fs: do not skip dentry block writes (diff) | |
download | linux-345a6b2ee2987a11bc8e9c08ff2b68a973fd912c.tar.xz linux-345a6b2ee2987a11bc8e9c08ff2b68a973fd912c.zip |
f2fs: fix to update {m,c}time correctly when truncating larger
This patch fixes to update ctime and atime correctly when truncating
larger in ->setattr.
The bug is reported by xfstest generic/313 as below:
generic/313 2s ... - output mismatch (see ./results/generic/313.out.bad)
--- tests/generic/313.out 2015-08-04 15:28:53.430798882 +0800
+++ results/generic/313.out.bad 2015-09-28 17:04:27.294278016 +0800
@@ -1,2 +1,4 @@
QA output created by 313
Silence is golden
+ctime not updated after truncate up
+mtime not updated after truncate up
...
(Run 'diff -u tests/generic/313.out tests/generic/313.out.bad' to see the entire diff)
Ran: generic/313
Failures: generic/313
Failed 1 of 1 tests
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | fs/f2fs/file.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 6702157801a6..a350c2aeccae 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -681,6 +681,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) * larger than i_size. */ truncate_setsize(inode, attr->ia_size); + inode->i_mtime = inode->i_ctime = CURRENT_TIME; } } |