Chao Yu
7a370ecb6f
f2fs: fix to update time in lazytime mode
...
[ Upstream commit fe1897eaa6 ]
generic/018 reports an inconsistent status of atime, the
testcase is as below:
- open file with O_SYNC
- write file to construct fraged space
- calc md5 of file
- record {a,c,m}time
- defrag file --- do nothing
- umount & mount
- check {a,c,m}time
The root cause is, as f2fs enables lazytime by default, atime
update will dirty vfs inode, rather than dirtying f2fs inode (by set
with FI_DIRTY_INODE), so later f2fs_write_inode() called from VFS will
fail to update inode page due to our skip:
f2fs_write_inode()
if (is_inode_flag_set(inode, FI_DIRTY_INODE))
return 0;
So eventually, after evict(), we lose last atime for ever.
To fix this issue, we need to check whether {a,c,m,cr}time is
consistent in between inode cache and inode page, and only skip
f2fs_update_inode() if f2fs inode is not dirty and time is
consistent as well.
Signed-off-by: Chao Yu <yuchao0@huawei.com >
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2020-01-04 19:12:37 +01:00
..
2019-10-11 18:21:13 +02:00
2019-08-06 19:06:49 +02:00
2018-05-28 12:36:41 +02:00
2019-09-10 10:33:52 +01:00
2019-12-13 08:51:01 +01:00
2018-06-15 18:10:01 -03:00
2018-12-01 09:37:27 +01:00
2019-12-31 16:36:20 +01:00
2018-12-17 09:24:40 +01:00
2019-12-05 09:19:45 +01:00
2019-12-21 10:57:35 +01:00
2019-08-06 19:06:51 +02:00
2019-11-12 19:20:47 +01:00
2018-11-13 11:08:55 -08:00
2019-07-26 09:14:02 +02:00
2019-05-08 07:21:48 +02:00
2019-03-23 20:09:59 +01:00
2019-12-13 08:52:23 +01:00
2019-11-20 18:45:18 +01:00
2018-07-22 14:13:44 +02:00
2019-12-05 09:20:32 +01:00
2019-12-13 08:51:02 +01:00
2019-12-17 20:35:18 +01:00
2019-12-31 16:36:28 +01:00
2020-01-04 19:12:37 +01:00
2019-10-07 18:57:14 +02:00
2018-05-22 14:27:51 -04:00
2018-12-17 09:24:40 +01:00
2019-12-13 08:52:36 +01:00
2019-12-17 20:35:55 +01:00
2019-12-01 09:17:10 +01:00
2019-12-01 09:17:09 +01:00
2018-08-17 16:20:28 -07:00
2018-08-25 12:42:33 -07:00
2019-05-22 07:37:40 +02:00
2018-08-21 11:37:41 +02:00
2019-07-28 08:29:29 +02:00
2019-05-08 07:21:48 +02:00
2018-08-15 22:47:23 -07:00
2019-12-13 08:52:43 +01:00
2019-12-13 08:51:59 +01:00
2018-05-22 14:27:52 -04:00
2019-11-24 08:20:24 +01:00
2019-12-13 08:52:26 +01:00
2018-09-04 16:45:02 -07:00
2019-07-31 07:27:08 +02:00
2018-08-17 16:20:27 -07:00
2019-12-17 20:35:17 +01:00
2018-05-22 14:27:58 -04:00
2018-05-22 14:27:57 -04:00
2019-11-24 08:20:57 +01:00
2019-12-17 20:34:51 +01:00
2019-12-17 20:35:45 +01:00
2019-12-13 08:52:24 +01:00
2018-05-22 14:27:52 -04:00
2018-05-22 14:27:54 -04:00
2019-12-17 20:35:19 +01:00
2019-12-17 20:35:20 +01:00
2018-05-22 14:27:55 -04:00
2018-08-02 09:34:02 -07:00
2018-08-18 11:44:53 -07:00
2018-12-17 09:24:30 +01:00
2018-07-31 11:32:44 -04:00
2019-12-05 09:20:09 +01:00
2019-11-20 18:46:04 +01:00
2019-05-25 18:23:46 +02:00
2019-12-13 08:52:57 +01:00
2019-05-02 09:58:59 +02:00
2018-07-12 10:04:27 -04:00
2018-07-03 16:44:45 -04:00
2018-07-12 10:04:20 -04:00
2018-06-12 16:19:22 -07:00
2019-10-05 13:10:06 +02:00
2019-07-03 13:14:44 +02:00
2018-07-10 23:29:03 -04:00
2019-11-06 13:05:37 +01:00
2019-04-17 08:38:52 +02:00
2019-04-05 22:33:00 +02:00
2019-05-31 06:46:27 -07:00
2019-11-20 18:46:33 +01:00
2018-06-05 19:23:26 +02:00
2019-08-16 10:12:52 +02:00
2019-05-25 18:23:26 +02:00
2019-03-05 17:58:50 +01:00
2019-03-13 14:02:32 -07:00
2018-06-28 10:40:47 -07:00
2019-02-12 19:47:19 +01:00
2019-08-04 09:30:56 +02:00
2018-08-15 23:03:20 -05:00
2018-08-21 18:19:09 -07:00
2019-04-05 22:32:59 +02:00
2018-05-16 07:23:35 +02:00
2019-11-12 19:21:20 +01:00
2019-06-22 08:15:21 +02:00
2019-05-31 06:46:05 -07:00
2018-11-21 09:19:14 +01:00
2019-12-13 08:52:56 +01:00
2018-06-11 08:22:34 -07:00
2018-08-02 08:06:55 +09:00
2019-10-17 13:45:35 -07:00
2018-08-21 18:19:09 -07:00
2018-06-11 08:22:34 -07:00
2018-06-12 16:19:22 -07:00
2018-08-17 16:20:29 -07:00
2018-12-29 13:37:54 +01:00
2018-11-21 09:19:22 +01:00
2019-05-25 18:23:26 +02:00
2019-07-31 07:27:11 +02:00
2019-05-04 09:20:11 +02:00
2019-12-01 09:17:04 +01:00
2018-06-28 10:40:47 -07:00
2019-08-25 10:47:43 +02:00
2018-06-16 16:21:50 +09:00
2019-12-17 20:35:43 +01:00
2019-10-11 18:21:39 +02:00
2018-08-26 11:48:42 -07:00
2018-08-13 20:56:23 -07:00
2019-08-29 08:28:52 +02:00
2018-09-18 07:30:48 -04:00