aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-06-04 23:20:17 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-06-04 14:31:11 -0700
commita1f72ac2c0a8d8a3488b31867c9255264331a4db (patch)
treef61d166a69bd130f8cade778733f9170a52ce4c0 /fs/f2fs/checkpoint.c
parentfs: f2fs: insert space around that ':' and ', ' (diff)
downloadwireguard-linux-a1f72ac2c0a8d8a3488b31867c9255264331a4db.tar.xz
wireguard-linux-a1f72ac2c0a8d8a3488b31867c9255264331a4db.zip
f2fs: fix to update mtime correctly
If we change system time to the past, get_mtime() will return a overflowed time, and SIT_I(sbi)->max_mtime will be udpated incorrectly, this patch fixes the two issues. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 8eb184c3de84..40b39db317ea 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -1233,7 +1233,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
* modify checkpoint
* version number is already updated
*/
- ckpt->elapsed_time = cpu_to_le64(get_mtime(sbi));
+ ckpt->elapsed_time = cpu_to_le64(get_mtime(sbi, true));
ckpt->free_segment_count = cpu_to_le32(free_segments(sbi));
for (i = 0; i < NR_CURSEG_NODE_TYPE; i++) {
ckpt->cur_node_segno[i] =