[PATCH v4] f2fs-tools: introduce set_node_footer to initialize node footer

2020-06-19 Thread zhaowuyun
From: Wuyun Zhao the filesystem will use the cold flag, so deal with it to avoid potential issue of inconsistency Signed-off-by: Wuyun Zhao Reviewed-by: Chao Yu --- fsck/dir.c | 7 ++- fsck/node.c| 12 +--- include/f2fs_fs.h | 23 +++ mkfs/f2f

[PATCH v3] f2fs-tools: introduce set_node_footer to initialize node footer

2020-06-19 Thread zhaowuyun
From: Wuyun Zhao the filesystem will use the cold flag, so deal with it to avoid potential issue of inconsistency Signed-off-by: Wuyun Zhao --- fsck/dir.c | 7 ++- fsck/node.c| 12 +--- include/f2fs_fs.h | 23 +++ mkfs/f2fs_format.c | 34 ++

[PATCH v2] f2fs-tools: introduce set_node_footer to initialize node footer

2020-06-18 Thread zhaowuyun
From: Wuyun Zhao the filesystem will use the cold flag, so deal with it to avoid potential issue of inconsistency Signed-off-by: Wuyun Zhao --- fsck/dir.c | 6 +- fsck/node.c| 9 + include/f2fs_fs.h | 20 mkfs/f2fs_format.c | 14 +

[PATCH] f2fs-tools: set cold flag for non-dir node

2020-06-18 Thread zhaowuyun
From: Wuyun Zhao Signed-off-by: Wuyun Zhao --- fsck/dir.c | 1 + fsck/node.c | 1 + fsck/node.h | 11 +++ 3 files changed, 13 insertions(+) diff --git a/fsck/dir.c b/fsck/dir.c index 5f4f75e..dc03c98 100644 --- a/fsck/dir.c +++ b/fsck/dir.c @@ -522,6 +522,7 @@ static void init_inode

[PATCH v2] f2fs: fix a race condition between f2fs_write_end_io and f2fs_del_fsync_node_entry

2020-06-17 Thread zhaowuyun
From: Wuyun Zhao Under some condition, the __write_node_page will submit a page which is not f2fs_in_warm_node_list and will not call f2fs_add_fsync_node_entry. f2fs_gc continue to run to invoke f2fs_iget -> do_read_inode to read the same node page and set code node, which make f2fs_in_warm_node

[PATCH] f2fs: fix a race condition between f2fs_write_end_io and f2fs_del_fsync_node_entry

2020-06-17 Thread zhaowuyun
From: Wuyun Zhao Under some condition, the __write_node_page will submit a page which is not f2fs_in_warm_node_list and will not call f2fs_add_fsync_node_entry. f2fs_gc continue to run to invoke f2fs_iget -> do_read_inode to read the same node page and set code node, which make f2fs_in_warm_node