Re: [f2fs-dev] [PATCH v3] f2fs: report error if quota off error during umount

2018-07-28 Thread Chao Yu
Ping, On 2018/6/26 16:34, Chao Yu wrote: > On 2018/6/26 13:12, Yunlei He wrote: >> Now, we depend on fsck to ensure quota file data is ok, >> so we scan whole partition if checkpoint without umount >> flag. It's same for quota off error case, which may make >> quota file data inconsistent. >> >>

[f2fs-dev] [PATCH] f2fs: fix to reset i_gc_failures correctly

2018-07-28 Thread Chao Yu
Let's reset i_gc_failures to zero when we unset pinned state for file. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index ed5c9b0e0d0c..22c83da0d5e2 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c

[f2fs-dev] [PATCH] f2fs-tools: fix to reset i_gc_failures offline

2018-07-28 Thread Chao Yu
This patch synchronize f2fs_inode structure from kernel side, in addition, it adds to check .i_gc_failures and do resetting in fsck. Signed-off-by: Chao Yu --- fsck/dir.c | 5 - fsck/fsck.c| 16 include/f2fs_fs.h | 8 +++- mkfs/f2fs_format.c | 2 +-

[f2fs-dev] [PATCH] fsck.f2fs: print node block address

2018-07-28 Thread Chao Yu
Print block address of unreachable node id in fsck_verify() for better debugging. Signed-off-by: Chao Yu --- fsck/fsck.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index bb1da0305f2c..20a569228516 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c

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

2018-07-28 Thread Chao Yu
On 2018/7/29 9:33, Jaegeuk Kim wrote: > On 07/28, Chao Yu wrote: >> 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

Re: [f2fs-dev] [PATCH v3] f2fs: report error if quota off error during umount

2018-07-28 Thread Jaegeuk Kim
On 07/29, Chao Yu wrote: > On 2018/7/29 10:06, Jaegeuk Kim wrote: > > On 07/28, Chao Yu wrote: > >> Ping, > > > > Please check dev-test. > > I still can't find this patch in last dev-test... Oh, I recalled what happened on this patch. I didn't merge this, since fault injection test was failed

Re: [f2fs-dev] [PATCH] f2fs: avoid race between zero_range and background GC

2018-07-28 Thread Jaegeuk Kim
On 07/29, Chao Yu wrote: > On 2018/7/29 10:59, Jaegeuk Kim wrote: > > On 07/29, Chao Yu wrote: > >> On 2018/7/29 10:02, Jaegeuk Kim wrote: > >>> On 07/27, Chao Yu wrote: > On 2018/7/27 18:29, Jaegeuk Kim wrote: > > On 07/26, Chao Yu wrote: > >> Thread A

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

2018-07-28 Thread Jaegeuk Kim
On 07/28, Chao Yu wrote: > 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

Re: [f2fs-dev] [PATCH] f2fs: avoid race between zero_range and background GC

2018-07-28 Thread Chao Yu
On 2018/7/29 10:59, Jaegeuk Kim wrote: > On 07/29, Chao Yu wrote: >> On 2018/7/29 10:02, Jaegeuk Kim wrote: >>> On 07/27, Chao Yu wrote: On 2018/7/27 18:29, Jaegeuk Kim wrote: > On 07/26, Chao Yu wrote: >> Thread A Background GC >> - f2fs_zero_range >>

Re: [f2fs-dev] [PATCH v3] f2fs: report error if quota off error during umount

2018-07-28 Thread Chao Yu
On 2018/7/29 10:06, Jaegeuk Kim wrote: > On 07/28, Chao Yu wrote: >> Ping, > > Please check dev-test. I still can't find this patch in last dev-test... Thanks, > >> >> On 2018/6/26 16:34, Chao Yu wrote: >>> On 2018/6/26 13:12, Yunlei He wrote: Now, we depend on fsck to ensure quota file

[f2fs-dev] [PATCH] f2fs: fix to clear PG_checked flag in set_page_dirty()

2018-07-28 Thread Chao Yu
From: Chao Yu PG_checked flag will be set on data page during GC, later, we can recognize such page by the flag and migrate page to cold segment. But previously, we don't clear this flag when invalidating data page, after page redirtying, we will write it into wrong log. Let's clear PG_checked

Re: [f2fs-dev] [PATCH 3/3] mkfs.f2fs: Fix the checkpoint version written to the footer of the root's inode

2018-07-28 Thread Jaegeuk Kim
On 07/26, Sotirios-Efstathios Maneas wrote: > Fix the checkpoint version written to the footer of the root's inode. What does this patch to fix? The checkpoint_ver in footer is to detect the node is recoverable or not during roll-forward recovery. So, root_inode doesn't require to have the exact

Re: [f2fs-dev] [PATCH 2/3] mkfs.f2fs: Fixed typos in several printed messages.

2018-07-28 Thread Jaegeuk Kim
On 07/26, Sotirios-Efstathios Maneas wrote: > Fixed typos in several printed messages. Thanks, merged. > > --- > mkfs/f2fs_format.c | 18 +- > mkfs/f2fs_format_main.c | 8 > 2 files changed, 13 insertions(+), 13 deletions(-) > > diff --git a/mkfs/f2fs_format.c

Re: [f2fs-dev] [PATCH 1/3] mkfs.f2fs: Missing error check statement while allocating memory to write the super block.

2018-07-28 Thread Jaegeuk Kim
On 07/26, Sotirios-Efstathios Maneas wrote: > Added a missing error check statement while allocating memory to write the > super block. > > --- > mkfs/f2fs_format.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c > index 1a2deae..491a9da

Re: [f2fs-dev] [PATCH 4/4] f2fs: fix to spread clear_cold_data()

2018-07-28 Thread Jaegeuk Kim
On 07/27, Chao Yu wrote: > We need to drop PG_checked flag on page as well when we clear PG_uptodate > flag, in order to avoid treating the page as GCing one later. What do you mean "treating the page as GCing one"? > > Signed-off-by: Weichao Guo > Signed-off-by: Chao Yu > --- >

Re: [f2fs-dev] [PATCH 4/4] f2fs: fix to spread clear_cold_data()

2018-07-28 Thread Jaegeuk Kim
On 07/29, Chao Yu wrote: > On 2018/7/29 10:00, Jaegeuk Kim wrote: > > On 07/27, Chao Yu wrote: > >> We need to drop PG_checked flag on page as well when we clear PG_uptodate > >> flag, in order to avoid treating the page as GCing one later. > > > > What do you mean "treating the page as GCing

Re: [f2fs-dev] [PATCH 4/4] f2fs: fix to spread clear_cold_data()

2018-07-28 Thread Chao Yu
On 2018/7/29 10:44, Jaegeuk Kim wrote: > On 07/29, Chao Yu wrote: >> On 2018/7/29 10:00, Jaegeuk Kim wrote: >>> On 07/27, Chao Yu wrote: We need to drop PG_checked flag on page as well when we clear PG_uptodate flag, in order to avoid treating the page as GCing one later. >>> >>> What do

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

2018-07-28 Thread Jaegeuk Kim
On 07/27, Chao Yu wrote: > On 2018/7/27 17:17, Jaegeuk Kim wrote: > > On 07/23, Chao Yu wrote: > >> 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 > >

Re: [f2fs-dev] [PATCH v3] f2fs: report error if quota off error during umount

2018-07-28 Thread Jaegeuk Kim
On 07/28, Chao Yu wrote: > Ping, Please check dev-test. > > On 2018/6/26 16:34, Chao Yu wrote: > > On 2018/6/26 13:12, Yunlei He wrote: > >> Now, we depend on fsck to ensure quota file data is ok, > >> so we scan whole partition if checkpoint without umount > >> flag. It's same for quota off

Re: [f2fs-dev] [PATCH] f2fs: avoid race between zero_range and background GC

2018-07-28 Thread Jaegeuk Kim
On 07/27, Chao Yu wrote: > On 2018/7/27 18:29, Jaegeuk Kim wrote: > > On 07/26, Chao Yu wrote: > >> Thread A Background GC > >> - f2fs_zero_range > >> - truncate_pagecache_range > >>- gc_data_segment > >>

Re: [f2fs-dev] [PATCH 4/4] f2fs: fix to spread clear_cold_data()

2018-07-28 Thread Chao Yu
On 2018/7/29 10:00, Jaegeuk Kim wrote: > On 07/27, Chao Yu wrote: >> We need to drop PG_checked flag on page as well when we clear PG_uptodate >> flag, in order to avoid treating the page as GCing one later. > > What do you mean "treating the page as GCing one"? I mean if PG_checked flag in page

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

2018-07-28 Thread Jaegeuk Kim
On 07/29, Chao Yu wrote: > On 2018/7/29 9:33, Jaegeuk Kim wrote: > > On 07/28, Chao Yu wrote: > >> 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

Re: [f2fs-dev] [PATCH] f2fs: avoid race between zero_range and background GC

2018-07-28 Thread Jaegeuk Kim
On 07/29, Chao Yu wrote: > On 2018/7/29 10:02, Jaegeuk Kim wrote: > > On 07/27, Chao Yu wrote: > >> On 2018/7/27 18:29, Jaegeuk Kim wrote: > >>> On 07/26, Chao Yu wrote: > Thread A Background GC > - f2fs_zero_range > - truncate_pagecache_range >

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to do sanity check with user_block_count

2018-07-28 Thread Jaegeuk Kim
On 07/28, Chao Yu wrote: > This patch fixs to do sanity check with user_block_count. > > - Overview > Divide zero in utilization when mount() a corrupted f2fs image > > - Reproduce (4.18 upstream kernel) > > - Kernel message > [ 564.099503] F2FS-fs (loop0): invalid crc value > [ 564.101991]

Re: [f2fs-dev] [PATCH 3/4] f2fs: fix avoid race between truncate and background GC

2018-07-28 Thread Jaegeuk Kim
On 07/27, Chao Yu wrote: > Thread A Background GC > - f2fs_setattr isize to 0 > - truncate_setsize > - gc_data_segment >- f2fs_get_read_data_page page #0 >

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

2018-07-28 Thread Chao Yu
On 2018/7/29 10:49, Jaegeuk Kim wrote: > On 07/29, Chao Yu wrote: >> On 2018/7/29 9:33, Jaegeuk Kim wrote: >>> On 07/28, Chao Yu wrote: 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

Re: [f2fs-dev] [PATCH] f2fs: avoid race between zero_range and background GC

2018-07-28 Thread Chao Yu
On 2018/7/29 10:02, Jaegeuk Kim wrote: > On 07/27, Chao Yu wrote: >> On 2018/7/27 18:29, Jaegeuk Kim wrote: >>> On 07/26, Chao Yu wrote: Thread A Background GC - f2fs_zero_range - truncate_pagecache_range -