Re: [f2fs-dev] [PATCH v2] mkfs.f2fs: check zeros in first 16MB for Android

2019-08-09 Thread Jaegeuk Kim
On 08/10, Ju Hyung Park wrote: > Hi Jaegeuk, > > Just out of curiosity, what's the point of this? > > I thought flash chips skip erasing blocks if it's already erased to > preserve P/E cycles as much as possible. > All Android devices I had(various versions of eMMC and UFS) ran full range > block

Re: [f2fs-dev] [PATCH v4] f2fs: Fix indefinite loop in f2fs_gc()

2019-08-09 Thread Jaegeuk Kim
On 08/07, Chao Yu wrote: > On 2019-8-7 21:40, Sahitya Tummala wrote: > > Policy - Foreground GC, LFS and greedy GC mode. > > > > Under this policy, f2fs_gc() loops forever to GC as it doesn't have > > enough free segements to proceed and thus it keeps calling gc_more > > for the same victim segmen

Re: [PATCH v3 RESEND] f2fs: introduce sb.required_features to store incompatible features

2019-08-09 Thread Jaegeuk Kim
On 08/06, Chao Yu wrote: > On 2019/8/6 10:11, Jaegeuk Kim wrote: > > On 08/06, Chao Yu wrote: > >> On 2019/8/6 9:24, Jaegeuk Kim wrote: > >>> On 08/06, Chao Yu wrote: > On 2019/8/6 8:35, Jaegeuk Kim wrote: > > On 08/02, Chao Yu wrote: > >> On 2019/8/2 6:35, Jaegeuk Kim wrote: > >>>

[f2fs-dev] [PATCH] f2fs_io: add get/setflags

2019-08-09 Thread Jaegeuk Kim
From: Jaegeuk Kim Signed-off-by: Jaegeuk Kim --- tools/f2fs_io/f2fs_io.c | 91 + tools/f2fs_io/f2fs_io.h | 14 +++ 2 files changed, 105 insertions(+) diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c index 6b43778..b57c458 100644 --- a/t

Re: [PATCH v2] f2fs: fix wrong available node count calculation

2019-08-09 Thread Jaegeuk Kim
On 08/06, Chao Yu wrote: > On 2019/8/5 18:27, Chao Yu wrote: > > In mkfs, we have counted quota file's node number in cp.valid_node_count, > > so we have to avoid wrong substraction of quota node number in > > .available_nid/.avail_node_count calculation. > > > > f2fs_write_check_point_pack() > >

Re: [f2fs-dev] [PATCH v2] mkfs.f2fs: check zeros in first 16MB for Android

2019-08-09 Thread Jaegeuk Kim
We actually don't need to issue trim on entire disk by checking first blocks having zeros. Signed-off-by: Jaegeuk Kim --- v2 from v1: - clean up mkfs/f2fs_format_utils.c | 53 ++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/mkfs/f2fs_form

[f2fs-dev] [PATCH 09/10] fsck.f2fs: fix to propagate error of write_dquots()

2019-08-09 Thread Chao Yu
Propagate correct error number from write_dquots() to quota_write_inode(). Signed-off-by: Chao Yu --- fsck/mkquota.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fsck/mkquota.c b/fsck/mkquota.c index c1abbc4..84f9d3d 100644 --- a/fsck/mkquota.c +++ b/fsck/mkquot

[f2fs-dev] [PATCH 02/10] f2fs-tools: fix to avoid memory leak of sit_i->sentries

2019-08-09 Thread Chao Yu
We missed to free sit_i->sentries in f2fs_do_umount(), fix it. Signed-off-by: Chao Yu --- fsck/mount.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fsck/mount.c b/fsck/mount.c index f97c4ea..af7149e 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -2917,6 +2917,7 @@ void f2fs_do_umount(str

[f2fs-dev] [PATCH 07/10] fsck.f2fs: fix to set large section type during allocation

2019-08-09 Thread Chao Yu
During block allocation in large free section, we need to change all sub segments' type in it, otherwise, we will fail to allocate block in non-first segment due to mismatch seg-type. Signed-off-by: Chao Yu --- fsck/mount.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-

[f2fs-dev] [PATCH 10/10] f2fs-tools: add missing newline symbol in log

2019-08-09 Thread Chao Yu
to show pretty log format. Signed-off-by: Chao Yu --- fsck/segment.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fsck/segment.c b/fsck/segment.c index 2d18358..b0c6889 100644 --- a/fsck/segment.c +++ b/fsck/segment.c @@ -28,23 +28,23 @@ int reserve_new_block(struc

[f2fs-dev] [PATCH 06/10] dump.f2fs: introduce start_bidx_of_node() for cleanup

2019-08-09 Thread Chao Yu
Just cleanup, no logic change, besides, it can be reused by latter patch. Signed-off-by: Chao Yu --- fsck/dump.c | 39 +++ 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index 390361d..a6a1635 100644 --- a/fsck/dump.c

[f2fs-dev] [PATCH 04/10] fsck.f2fs: introduce current_sit_addr() for cleanup

2019-08-09 Thread Chao Yu
Just clean up, no logic change. Signed-off-by: Chao Yu --- fsck/mount.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index bed22d5..eed27bf 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -1700,13 +1700,12 @@ stati

[f2fs-dev] [PATCH 05/10] f2fs-tools: introduce f2fs_ra_meta_pages()

2019-08-09 Thread Chao Yu
Introduce f2fs_ra_meta_pages() to readahead meta pages like we did in kernel. Signed-off-by: Chao Yu --- fsck/f2fs.h | 28 +++ fsck/fsck.c | 2 + fsck/fsck.h | 1 + fsck/mount.c | 119 ++ include/f2fs_fs.h | 5 ++

[f2fs-dev] [PATCH 03/10] f2fs-tools: allocate memory in batch in build_sit_info()

2019-08-09 Thread Chao Yu
Like we did in kernel, allocating memory in batch will be more efficient. Signed-off-by: Chao Yu --- fsck/f2fs.h | 1 + fsck/mount.c | 28 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/fsck/f2fs.h b/fsck/f2fs.h index a52b5d4..6fc0bf3 100644 --- a

[f2fs-dev] [PATCH 01/10] f2fs-tools: fix potential deadloop

2019-08-09 Thread Chao Yu
In error path of build_sit_info(), start variable is unsigned int type, it should never be less than zero, fix it. build_sit_info() { ... unsigned int start; ... free_validity_maps: for (--start ; start >= 0; --start) free(sit_i->sentries[start].cur_valid_map); ...

[f2fs-dev] [PATCH 08/10] f2fs-tools: advise to mount unclean image to replay journal

2019-08-09 Thread Chao Yu
For defrag, resize, sload tools, let's advise to mount unclean image to replay journal first in order to not lose any fsynced data. Signed-off-by: Chao Yu --- fsck/mount.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fsck/mount.c b/fsck/mount.c index ad20d19..6e950bd 100644 --- a/fs