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

2018-07-27 Thread Chao Yu
On 2018/7/26 20:35, Sheng Yong wrote: > If a quota node is corrupted, it may be unreachable. But its qf_ino in > super blocks is not cleared. To keep quota feature available, let's try > to rebuild a new quota node. > > Disk quota entries are written back according to data recorded in > the dict.

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

2018-07-27 Thread Sheng Yong
On 2018/7/27 17:23, Jaegeuk Kim wrote: On 07/24, Sheng Yong wrote: 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

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

2018-07-27 Thread 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 being broken by

[f2fs-dev] [PATCH v2] f2fs: fix to do sanity check with node footer and iblocks

2018-07-27 Thread Chao Yu
This patch adds to do sanity check with below fields of inode to avoid reported panic. - node footer - iblocks https://bugzilla.kernel.org/show_bug.cgi?id=200223 - Overview BUG() triggered in f2fs_truncate_inode_blocks() when un-mounting a mounted f2fs image after writing to it - Reproduce -

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

2018-07-27 Thread Chao Yu
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] divide error: [#1] SMP KASAN PTI [

Re: [f2fs-dev] [RFC PATCH v2] fsck.f2fs: write checkpoint out of place first

2018-07-27 Thread Chao Yu
On 2018/7/27 4:54, Weichao Guo wrote: > We may encounter both checkpoints invalid in such a case: > 1. write checkpoint A, B, C; > 2. sudden power-cut during write checkpoint D; > 3. fsck changes the total block count of checkpoint C; > 4. sudden power-cut during fsck write checkpoint C in place >

Re: [f2fs-dev] [PATCH] mkfs.f2fs: add -R 0:0 by default for android

2018-07-27 Thread Chao Yu
On 2018/7/27 16:48, Jaegeuk Kim wrote: > This patch sets "-R 0:0" for android by default. > > Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, -- Check out the vibrant tech community on one of the world's

Re: [f2fs-dev] [PATCH] mkfs.f2fs: add root_owner to give uid/gid

2018-07-27 Thread Chao Yu
On 2018/7/27 16:21, Jaegeuk Kim wrote: > This patch adds an option to mkfs.f2fs in order for user to assign uid/gid > to the target partition. > This requires when vold in android formats a sdcard partition. > > Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks,

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

2018-07-27 Thread Chao Yu
On 2018/7/27 6:01, Sotirios-Efstathios Maneas wrote: > Added a missing error check statement while allocating memory to write the > super block. > Missed a Signed-off-by in all your patch? Thanks, > --- > mkfs/f2fs_format.c | 4 > 1 file changed, 4 insertions(+) > > diff --git

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

2018-07-27 Thread Jaegeuk Kim
On 07/24, Sheng Yong wrote: > 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

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

2018-07-27 Thread Chao Yu
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 >> - get_read_data_page >>

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

2018-07-27 Thread Chao Yu
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. Signed-off-by: Weichao Guo Signed-off-by: Chao Yu --- fs/f2fs/data.c| 8 +++- fs/f2fs/dir.c | 1 + fs/f2fs/segment.c | 4 +++- 3 files changed, 11

[f2fs-dev] [PATCH 1/4] f2fs: don't keep meta pages used for block migration

2018-07-27 Thread Chao Yu
For migration of encrypted inode's block, we load data of encrypted block into meta inode's page cache, after checkpoint, those all intermediate pages should be clean, and no one will read them again, so let's just release them for more memory. Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c |

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

2018-07-27 Thread Chao Yu
Thread ABackground GC - f2fs_setattr isize to 0 - truncate_setsize - gc_data_segment - f2fs_get_read_data_page page #0 - set_page_dirty

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

2018-07-27 Thread Sotirios-Efstathios Maneas
Fixed typos in several printed messages. --- 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 b/mkfs/f2fs_format.c index 491a9da..d844563 100644 --- a/mkfs/f2fs_format.c +++

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

2018-07-27 Thread Sotirios-Efstathios Maneas
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 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@

Re: [f2fs-dev] [PATCH] f2fs: fix 32-bit format string warning

2018-07-27 Thread Jaegeuk Kim
On 07/25, Arnd Bergmann wrote: > On Wed, Jul 25, 2018 at 5:21 PM, Chao Yu wrote: > > On 2018/7/24 17:34, Arnd Bergmann wrote: > >> On 32-bit targets, size_t is often 'unsigned int', so printing it as %lu > >> causes a warning: > >> > >> fs/f2fs/inode.c: In function 'sanity_check_inode': > >>

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

2018-07-27 Thread Sotirios-Efstathios Maneas
Fix the checkpoint version written to the footer of the root's inode. --- mkfs/f2fs_format.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index d844563..fe3112e 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@

Re: [f2fs-dev] [PATCH] f2fs: fix to restrict mount condition when without CONFIG_QUOTA

2018-07-27 Thread Chao Yu
On 2018/7/27 18:08, Jaegeuk Kim wrote: > On 07/25, Chao Yu wrote: >> From: Chao Yu >> >> Like quota_ino feature, we need to reject mounting RDWR with image >> which enables project_quota feature when there is no CONFIG_QUOTA >> be set in kernel. >> >> Signed-off-by: Chao Yu >> --- >>

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

2018-07-27 Thread Chao Yu
On 2018/7/27 18:03, Jaegeuk Kim wrote: > On 07/25, 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] f2fs: fix to restrict mount condition when without CONFIG_QUOTA

2018-07-27 Thread Jaegeuk Kim
On 07/25, Chao Yu wrote: > From: Chao Yu > > Like quota_ino feature, we need to reject mounting RDWR with image > which enables project_quota feature when there is no CONFIG_QUOTA > be set in kernel. > > Signed-off-by: Chao Yu > --- > fs/f2fs/super.c | 6 ++ > 1 file changed, 6

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

2018-07-27 Thread Jaegeuk Kim
On 07/25, 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

[f2fs-dev] [PATCH] mkfs.f2fs: add root_owner to give uid/gid

2018-07-27 Thread Jaegeuk Kim
This patch adds an option to mkfs.f2fs in order for user to assign uid/gid to the target partition. This requires when vold in android formats a sdcard partition. Signed-off-by: Jaegeuk Kim --- include/f2fs_fs.h | 22 ++ lib/libf2fs.c | 4

[f2fs-dev] [PATCH] mkfs.f2fs: add -R 0:0 by default for android

2018-07-27 Thread Jaegeuk Kim
This patch sets "-R 0:0" for android by default. Signed-off-by: Jaegeuk Kim --- mkfs/f2fs_format_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c index 6bcfbb0..fb3e8fd 100644 --- a/mkfs/f2fs_format_main.c +++

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

2018-07-27 Thread Chao Yu
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 added a > threshold, 20% over memory

Re: [f2fs-dev] [PATCH] f2fs: relocate f2fs_sanity_check_ckpt() and make it static

2018-07-27 Thread Chao Yu
Hi Jaegeuk, On 2018/7/27 18:25, Jaegeuk Kim wrote: > Hi Chao, > > I don't see any reason to do this at all. Hmm.. f2fs_sanity_check_ckpt() is not used in super.c and there-in code logic is not related to super.c too, instead, it is all related to checkpoint.c. So I just want to unify

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

2018-07-27 Thread Jaegeuk Kim
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 added a > >>> threshold, 20% over memory footprint, which disallows further atomic >

Re: [f2fs-dev] [PATCH v14 00/74] Convert page cache to XArray

2018-07-27 Thread Ross Zwisler
On Wed, Jul 25, 2018 at 02:03:23PM -0700, Matthew Wilcox wrote: > On Wed, Jun 27, 2018 at 01:44:38PM -0600, Ross Zwisler wrote: > > On Wed, Jun 27, 2018 at 04:05:29AM -0700, Matthew Wilcox wrote: > > > On Tue, Jun 19, 2018 at 10:16:38AM -0700, Matthew Wilcox wrote: > > > > I think I see a bug. No

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

2018-07-27 Thread Jaegeuk Kim
On 07/23, Sotirios-Efstathios Maneas wrote: > 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.