Re: [f2fs-dev] [PATCH 2/2] fsck.f2fs: check extra_attr feature

2018-07-08 Thread Sheng Yong
On 2018/7/9 10:15, Chao Yu wrote: Hi Sheng, On 2018/7/3 18:10, Sheng Yong wrote: Check extra_attr feature for inode. If it is corrupted, remove the inode. Could you check the patch: [PATCH] fsck.f2fs: fix to do sanity check with extra_attr feature Would it better to do sanity check with

Re: [f2fs-dev] Bug report: some new bugs found by fuzzing

2018-07-08 Thread Chao Yu
I updated a commit, could you have a try with last f2fs-dev? On 2018/7/8 10:43, Xu, Wen wrote: > It is already fixed by the latest commit in your git tree? > > Thanks, > Wen > >> On Jul 7, 2018, at 12:32 PM, Chao Yu wrote: >> >> On 2018/7/7 23:48, Xu, Wen wrote: >>> Sure I will do it. So you ar

Re: [f2fs-dev] [PATCH 2/2] fsck.f2fs: check extra_attr feature

2018-07-08 Thread Chao Yu
Hi Sheng, On 2018/7/3 18:10, Sheng Yong wrote: > Check extra_attr feature for inode. If it is corrupted, remove the > inode. Could you check the patch: [PATCH] fsck.f2fs: fix to do sanity check with extra_attr feature Would it better to do sanity check with it in fsck_chk_inode_blk? since it is

Re: [f2fs-dev] [PATCH 1/2] fsck.f2fs: check extent of inline data/dentry inode

2018-07-08 Thread Chao Yu
On 2018/7/3 18:10, Sheng Yong wrote: > Check extent for inline data/dentry inode. If an inode contains inline > data/dentry, it should have no extent. > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=200175 > Reported-by: Wen Xu > Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Thanks,

[f2fs-dev] [PATCH 5/5] f2fs: fix to propagate error from __get_meta_page()

2018-07-08 Thread Chao Yu
From: Chao Yu If caller of __get_meta_page() can handle error, let's propagate error from __get_meta_page(). Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c | 21 + fs/f2fs/f2fs.h | 2 +- fs/f2fs/node.c | 27 +++ fs/f2fs/recovery.c |

[f2fs-dev] [PATCH 1/5] f2fs: detect bug_on in f2fs_wait_discard_bios

2018-07-08 Thread Chao Yu
From: Chao Yu Add bug_on to detect potential non-empty discard wait list. Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index cbf8f3f9a8e7..e55188975fcc 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segme

[f2fs-dev] [PATCH 2/5] f2fs: clean up with IS_INODE()

2018-07-08 Thread Chao Yu
From: Chao Yu Signed-off-by: Chao Yu --- fs/f2fs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 8211f5c288a1..b0ab39d83235 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -122,7 +122,7 @@ static bool f2fs_enable_inode_ch

[f2fs-dev] [PATCH 3/5] f2fs: fix to do sanity check with i_extra_isize

2018-07-08 Thread Chao Yu
From: Chao Yu If inode.i_extra_isize was fuzzed to an abnormal value, when calculating inline data size, the result will overflow, result in accessing invalid memory area when operating inline data. Let's do sanity check with i_extra_isize during inode loading for fixing. https://bugzilla.kerne

[f2fs-dev] [PATCH 4/5] f2fs: fix to do sanity check with cp_pack_start_sum

2018-07-08 Thread Chao Yu
From: Chao Yu After fuzzing, cp_pack_start_sum could be corrupted, so current log's summary info should be wrong due to loading incorrect summary block. Then, if segment's type in current log is exceeded NR_CURSEG_TYPE, it can lead accessing invalid dirty_i->dirty_segmap bitmap finally. Add sani

[f2fs-dev] [PATCH v2] f2fs: split discard command in prior to block layer

2018-07-08 Thread Chao Yu
From: Chao Yu Some devices has small max_{hw,}discard_sectors, so that in __blkdev_issue_discard(), one big size discard bio can be split into multiple small size discard bios, result in heavy load in IO scheduler and device, which can hang other sync IO for long time. Now, f2fs is trying to con

[f2fs-dev] [PATCH v2 2/2] f2fs: issue small discard by LBA order

2018-07-08 Thread Chao Yu
From: Chao Yu For small granularity discard which size is smaller than 64KB, if we issue those kind of discards orderly by size, their IOs will be spread into entire logical address, so that in FTL, L2P table will be updated randomly, result bad wear rate in the table. In this patch, we choose t

[f2fs-dev] [PATCH] f2fs: stop issuing discard immediately if there is queued IO

2018-07-08 Thread Chao Yu
From: Chao Yu For background discard policy, even if there is queued user IO, still we will check max_requests times for next discard entry, it is unneeded, let's just stop this round submission immediately. Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 11 +-- 1 file changed, 5 inser

[f2fs-dev] [PATCH v3 2/2] f2fs: let checkpoint flush dnode page of regular

2018-07-08 Thread Chao Yu
From: Chao Yu Fsyncer will wait on all dnode pages of regular writeback before flushing, if there are async dnode pages blocked by IO scheduler, it may decrease fsync's performance. In this patch, we choose to let f2fs_balance_fs_bg() to trigger checkpoint to flush these dnode pages of regular,

[f2fs-dev] [PATCH v3 1/2] f2fs: fix to avoid broken of dnode block list

2018-07-08 Thread Chao Yu
From: Chao Yu f2fs recovery flow is relying on dnode block link list, it means fsynced file recovery depends on previous dnode's persistence in the list, so during fsync() we should wait on all regular inode's dnode writebacked before issuing flush. By this way, we can avoid dnode block list bei