Re: [f2fs-dev] [PATCH 1/5] f2fs: clear victim_secmap when section has full valid blocks

2018-07-23 Thread Chao Yu
On 2018/7/23 22:10, Yunlong Song wrote: > Without this patch, f2fs only clears victim_secmap when it finds out > that the section has no valid blocks at all, but forgets to clear the > victim_secmap when the whole section has full valid blocks. > > Signed-off-by: Yunlong Song > --- >

Re: [f2fs-dev] [PATCH v3] f2fs: issue discard align to section in LFS mode

2018-07-23 Thread Chao Yu
On 2018/7/19 20:58, Yunlong Song wrote: > For the case when sbi->segs_per_sec > 1 with lfs mode, take > section:segment = 5 for example, if the section prefree_map is > ...previous section | current section (1 1 0 1 1) | next section..., > then the start = x, end = x + 1, after start = start_segno

Re: [f2fs-dev] [PATCH] f2fs: fix wrong kernel message when recover fsync data on ro fs

2018-07-23 Thread Chao Yu
On 2018/7/19 14:57, Yunlei He wrote: > This patch fix wrong message info for recover fsync data > on readonly fs. > > Signed-off-by: Yunlei He Reviewed-by: Chao Yu Thanks, -- Check out the vibrant tech community on

[f2fs-dev] [PATCH] mkfs.f2fs: Fix the checkpoint version written to the footer of the root inode

2018-07-23 Thread Sotirios-Efstathios Maneas
Dear all, The following patch fixes the checkpoint version written to the footer of the inode associated with the root directory, while creating the file system from scratch. Furthermore, the patch fixes some typos in the printed messages. diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c

Re: [f2fs-dev] [PATCH] fsck.f2fs: rebuild qf_ino if quota node is corrupted

2018-07-23 Thread Sheng Yong
Hi, Jaegeuk On 2018/7/23 20:49, Jaegeuk Kim wrote: On 07/23, Sheng Yong wrote: If a quota node is corrupted, it may be removed. But its qf_ino in super blocks is not cleared. To keep quota feature available, let's try to rebuild a new quota node. Hi Sheng, IIRC, we need to rebuild whole

[f2fs-dev] [PATCH 1/5] f2fs: clear victim_secmap when section has full valid blocks

2018-07-23 Thread Yunlong Song
Without this patch, f2fs only clears victim_secmap when it finds out that the section has no valid blocks at all, but forgets to clear the victim_secmap when the whole section has full valid blocks. Signed-off-by: Yunlong Song --- fs/f2fs/segment.c | 4 +++- 1 file changed, 3 insertions(+), 1

[f2fs-dev] [PATCH 3/5] f2fs: clear_bit the SSR selected section in the victim_secmap

2018-07-23 Thread Yunlong Song
SSR uses get_victim to select ssr segment to allocate data blocks, which makes the previous result of victim_secmap inaccurately, so we would better clear the bit of the section in the victim_secmap. Signed-off-by: Yunlong Song --- fs/f2fs/gc.c | 3 ++- 1 file changed, 2 insertions(+), 1

[f2fs-dev] [PATCH 2/5] f2fs: add cur_victim_sec for BG_GC to avoid skipping BG_GC victim

2018-07-23 Thread Yunlong Song
If f2fs aborts BG_GC, then the section bit of victim_secmap will be set, which will cause the section skipped in the future get_victim of BG_GC. In a worst case that each section in the victim_secmap is set and there are enough free sections (so FG_GC can not be triggered), then BG_GC will skip

[f2fs-dev] [PATCH 5/5] f2fs: add proc entry to show victim_secmap bitmap

2018-07-23 Thread Yunlong Song
This patch adds a new proc entry to show victim_secmap information in more detail, which is very helpful to know the get_victim candidate status clearly, and helpful to debug problems (e.g., some sections can not gc all of its blocks, since some blocks belong to atomic file, leaving victim_secmap

[f2fs-dev] [PATCH 4/5] f2fs: let BG_GC check every dirty segments and gc over a threshold

2018-07-23 Thread Yunlong Song
BG_GC is triggered in idle time, so it is better check every dirty segment and finds the best victim to gc. Otherwise, BG_GC will be limited to only 8G areas, and probably select a victim which has nearly full of valid blocks, resulting a big WAI. Besides, we also add a bggc_threshold (which is

[f2fs-dev] [PATCH 0/5] f2fs: fix and improve for victim_secmap

2018-07-23 Thread Yunlong Song
There are some fixes and improvements for using with victim_secmap. Yunlong Song (5): f2fs: clear victim_secmap when section has full valid blocks f2fs: add cur_victim_sec for BG_GC to avoid skipping BG_GC victim f2fs: clear_bit the SSR selected section in the victim_secmap f2fs: let

Re: [f2fs-dev] [PATCH v2] f2fs: fix to do sanity check with inline flags

2018-07-23 Thread Chao Yu
On 2018/7/23 21:27, Jaegeuk Kim wrote: > On 07/23, Chao Yu wrote: >> On 2018/7/23 21:17, Jaegeuk Kim wrote: >>> On 07/15, Chao Yu wrote: Hi Jaegeuk, Could you try this v2 to see whether it can solve the error injection problem? >>> >>> That doesn't work still. >> >> Any dmesg

Re: [f2fs-dev] [PATCH v2] f2fs: fix to do sanity check with inline flags

2018-07-23 Thread Jaegeuk Kim
On 07/23, Chao Yu wrote: > On 2018/7/23 21:17, Jaegeuk Kim wrote: > > On 07/15, Chao Yu wrote: > >> Hi Jaegeuk, > >> > >> Could you try this v2 to see whether it can solve the error injection > >> problem? > > > > That doesn't work still. > > Any dmesg there? Just hit the below inline_data

Re: [f2fs-dev] [PATCH 1/3] f2fs: turn off atomic writes when deteting abnormal behaviors

2018-07-23 Thread Chao Yu
On 2018/7/23 21:03, Jaegeuk Kim wrote: > On 07/16, Chao Yu wrote: >> On 2018/7/15 9:11, Jaegeuk Kim wrote: >>> In order to prevent abusing atomic writes by abnormal users, we've added a >>> threshold, 20% over memory footprint, which disallows further atomic writes. >>> Previously, however, SQLite

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

2018-07-23 Thread Chao Yu
On 2018/7/23 20:47, Jaegeuk Kim wrote: > On 07/15, Chao Yu wrote: >> On 2018/7/15 11:13, Jaegeuk Kim wrote: >>> On 07/15, Chao Yu wrote: Hi Jaegeuk, On 2018/7/15 9:27, Jaegeuk Kim wrote: > On 07/08, Chao Yu wrote: >> From: Chao Yu >> >> Some devices has small

Re: [f2fs-dev] [PATCH v2] f2fs: fix to do sanity check with inline flags

2018-07-23 Thread Chao Yu
On 2018/7/23 21:17, Jaegeuk Kim wrote: > On 07/15, Chao Yu wrote: >> Hi Jaegeuk, >> >> Could you try this v2 to see whether it can solve the error injection >> problem? > > That doesn't work still. Any dmesg there? Thanks, > > Thanks, > >> >> Thanks, >> >> On 2018/6/29 0:19, Chao Yu wrote:

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

2018-07-23 Thread Chao Yu
On 2018/7/23 20:25, Jaegeuk Kim wrote: > On 07/20, Chao Yu wrote: >> Hi Jaegeuk, >> >> On 2018/7/15 9:30, Chao Yu wrote: >>> On 2018/7/14 13:44, Jaegeuk Kim wrote: On 07/08, Chao Yu wrote: > From: Chao Yu > > f2fs recovery flow is relying on dnode block link list, it means

Re: [f2fs-dev] [PATCH v2] f2fs: fix to do sanity check with inline flags

2018-07-23 Thread Jaegeuk Kim
On 07/15, Chao Yu wrote: > Hi Jaegeuk, > > Could you try this v2 to see whether it can solve the error injection problem? That doesn't work still. Thanks, > > Thanks, > > On 2018/6/29 0:19, Chao Yu wrote: > > From: Chao Yu > > > > https://bugzilla.kernel.org/show_bug.cgi?id=200221 > > > >

Re: [f2fs-dev] [PATCH] fsck.f2fs: rebuild qf_ino if quota node is corrupted

2018-07-23 Thread Jaegeuk Kim
On 07/23, Sheng Yong wrote: > If a quota node is corrupted, it may be removed. But its qf_ino in > super blocks is not cleared. To keep quota feature available, let's > try to rebuild a new quota node. Hi Sheng, IIRC, we need to rebuild whole quota structures, no? Thanks, > > Signed-off-by:

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

2018-07-23 Thread Jaegeuk Kim
On 07/15, Chao Yu wrote: > On 2018/7/15 11:13, Jaegeuk Kim wrote: > > On 07/15, Chao Yu wrote: > >> Hi Jaegeuk, > >> > >> On 2018/7/15 9:27, Jaegeuk Kim wrote: > >>> On 07/08, Chao Yu wrote: > From: Chao Yu > > Some devices has small max_{hw,}discard_sectors, so that in >

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

2018-07-23 Thread Jaegeuk Kim
On 07/20, Chao Yu wrote: > Hi Jaegeuk, > > On 2018/7/15 9:30, Chao Yu wrote: > > On 2018/7/14 13:44, Jaegeuk Kim wrote: > >> On 07/08, Chao Yu wrote: > >>> From: Chao Yu > >>> > >>> f2fs recovery flow is relying on dnode block link list, it means fsynced > >>> file recovery depends on previous

Re: [f2fs-dev] [PATCH 2/3] f2fs: keep meta pages in cp_error state

2018-07-23 Thread Jaegeuk Kim
On 07/16, Chao Yu wrote: > On 2018/7/15 9:11, Jaegeuk Kim wrote: > > It turns out losing meta pages in shutdown period makes f2fs very unstable > > so that I could see many unexpected error conditions. > > > > Let's keep meta pages for fault injection and sudden power-off tests. > > > >

Re: [f2fs-dev] [PATCH v6] f2fs: support in-memory inode checksum when checking consistency

2018-07-23 Thread Jaegeuk Kim
On 07/15, Chao Yu wrote: > Hi Weichao and Jaegeuk, > > On 2018/6/22 15:16, Chao Yu wrote: > > On 2018/6/12 22:36, Chao Yu wrote: > >> Ping, > >> > >> Jaegeuk, sometimes, we suffer data corruption caused by bit-transition of > >> cache, > >> we troubleshoot for weeks or months, and finally, find