Re: [f2fs-dev] [PATCH 2/4] f2fs: allow wrong configure dio to buffered write

2018-07-09 Thread Chao Yu
On 2018/7/10 4:41, Jaegeuk Kim wrote: > On 07/09, Chao Yu wrote: >> On 2018/7/7 5:09, Jaegeuk Kim wrote: >>> This fixes to support unaligned dio as buffered writes. >> >> Should we return -EINVAL as manual of write said: >> >> EINVAL fd is attached to an object which is unsuitable for writing; or

[f2fs-dev] [PATCH] f2fs: Keep alloc_valid_block_count in sync

2018-07-09 Thread Daniel Rosenberg via Linux-f2fs-devel
If we attempt to request more blocks than we have room for, we try to instead request as much as we can, however, alloc_valid_block_count is not decremented to match the new value, allowing it to drift higher until the next checkpoint. This always decrements it when the requested amount cannot be

Re: [f2fs-dev] [PATCH v2] fsck.f2fs: fix to do sanity check with extra_attr feature

2018-07-09 Thread Chao Yu
Hi Sheng, On 2018/7/10 9:55, Sheng Yong wrote: > Hi, Chao, > > On 2018/7/9 23:25, Chao Yu wrote: >> From: Chao Yu >> >> This patch tries to fix incorrect extra_attr bit or i_extra_isize value >> in fsck. >> >> Signed-off-by: Chao Yu >> --- >> v2: >> - fix to replace F2FS_INLINE_DATA with

Re: [f2fs-dev] [PATCH] f2fs-tools: avoid mounting f2fs if tools already open the device

2018-07-09 Thread Chao Yu
Hi Sheng, On 2018/7/10 9:53, Sheng Yong wrote: > Hi, Chao, > > On 2018/7/9 23:14, Chao Yu wrote: >> On 2018/7/4 17:50, Sheng Yong wrote: >>> If the block device is opened by tools, F2FS should not be mounted. >>> Especially when fsck is running, errors unexpected may happen. So if >>> tools open

Re: [f2fs-dev] [PATCH v2] fsck.f2fs: fix to do sanity check with extra_attr feature

2018-07-09 Thread Sheng Yong
Hi, Chao, On 2018/7/9 23:25, Chao Yu wrote: From: Chao Yu This patch tries to fix incorrect extra_attr bit or i_extra_isize value in fsck. Signed-off-by: Chao Yu --- v2: - fix to replace F2FS_INLINE_DATA with F2FS_EXTRA_ATTR. fsck/fsck.c | 18 +- 1 file changed, 17

Re: [f2fs-dev] [PATCH] f2fs-tools: avoid mounting f2fs if tools already open the device

2018-07-09 Thread Sheng Yong
Hi, Chao, On 2018/7/9 23:14, Chao Yu wrote: On 2018/7/4 17:50, Sheng Yong wrote: If the block device is opened by tools, F2FS should not be mounted. Especially when fsck is running, errors unexpected may happen. So if tools open a block device, we give it the O_EXCL flag to make sure the block

Re: [f2fs-dev] [PATCH] f2fs: fix defined but not used build warnings

2018-07-09 Thread Chao Yu
On 2018/7/7 11:50, Randy Dunlap wrote: > From: Randy Dunlap > > Fix build warnings in f2fs when CONFIG_PROC_FS is not enabled > by marking the unused functions as __maybe_unused. > > ../fs/f2fs/sysfs.c:519:12: warning: 'segment_info_seq_show' defined but not > used [-Wunused-function] >

[f2fs-dev] Bug report: null ptr dereference in fscrypt_do_page_crypto() when operating a file on a corrupted f2fs image

2018-07-09 Thread Xu, Wen
Hi Chao, Could you please check: https://bugzilla.kernel.org/show_bug.cgi?id=200465 This new issue cannot be solved by your recent commits from my testing. Thanks, Wen -- Check out the vibrant tech community on one of

Re: [f2fs-dev] [PATCH 1/4] f2fs: flush journal nat entries for nat_bits during unmount

2018-07-09 Thread Jaegeuk Kim
On 07/09, Chao Yu wrote: > On 2018/7/7 5:09, Jaegeuk Kim wrote: > > Let's flush journal nat entries for speed up in the next run. > > > > Signed-off-by: Jaegeuk Kim > > --- > > fs/f2fs/node.c | 7 +++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c

Re: [f2fs-dev] [PATCH 2/4] f2fs: allow wrong configure dio to buffered write

2018-07-09 Thread Jaegeuk Kim
On 07/09, Chao Yu wrote: > On 2018/7/7 5:09, Jaegeuk Kim wrote: > > This fixes to support unaligned dio as buffered writes. > > Should we return -EINVAL as manual of write said: > > EINVAL fd is attached to an object which is unsuitable for writing; or the > file > was opened with the O_DIRECT

Re: [f2fs-dev] [PATCH 4/4] f2fs: should check the type of end_io after pullback by fscrypto

2018-07-09 Thread Jaegeuk Kim
On 07/09, Chao Yu wrote: > On 2018/7/7 5:09, Jaegeuk Kim wrote: > > This fixes to get the page type after pullback by fscrypto, since the > > original > > page is bounce page but we should need to get control page which is what we > > originally submitted. > > > > Signed-off-by: Jaegeuk Kim > >

Re: [f2fs-dev] [PATCH] f2fs: do checkpoint in kill_sb

2018-07-09 Thread Jaegeuk Kim
On 07/09, Chao Yu wrote: > On 2018/7/7 9:20, Jaegeuk Kim wrote: > > When unmounting f2fs in force mode, we can get it stuck by io_schedule() > > force mode means force shutdown? Yes. > > > by some pending IOs in meta_inode. > > > > io_schedule+0xd/0x30 > > wait_on_page_bit_common+0xc6/0x130 >

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

2018-07-09 Thread Xu, Wen
Yeah, the issues are all fixed by your commits regarding my tests. Thanks, Wen > On Jul 9, 2018, at 11:10 AM, Chao Yu wrote: > > I guess, could you please test it? > > Thanks, > > On 2018/7/8 10:43, Xu, Wen wrote: >> It is already fixed by the latest commit in your git tree? >> >> Thanks,

[f2fs-dev] [PATCH v2] fsck.f2fs: fix to do sanity check with extra_attr feature

2018-07-09 Thread Chao Yu
From: Chao Yu This patch tries to fix incorrect extra_attr bit or i_extra_isize value in fsck. Signed-off-by: Chao Yu --- v2: - fix to replace F2FS_INLINE_DATA with F2FS_EXTRA_ATTR. fsck/fsck.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/fsck/fsck.c

Re: [f2fs-dev] [PATCH] f2fs-tools: avoid mounting f2fs if tools already open the device

2018-07-09 Thread Chao Yu
On 2018/7/4 17:50, Sheng Yong wrote: > If the block device is opened by tools, F2FS should not be mounted. > Especially when fsck is running, errors unexpected may happen. So if > tools open a block device, we give it the O_EXCL flag to make sure > the block device is opened exclusivly. Should we

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

2018-07-09 Thread Chao Yu
I guess, could you please test it? Thanks, 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 are still willing

Re: [f2fs-dev] [PATCH] f2fs: do checkpoint in kill_sb

2018-07-09 Thread Chao Yu
On 2018/7/7 9:20, Jaegeuk Kim wrote: > When unmounting f2fs in force mode, we can get it stuck by io_schedule() force mode means force shutdown? > by some pending IOs in meta_inode. > > io_schedule+0xd/0x30 > wait_on_page_bit_common+0xc6/0x130 Looks like a deadlock here? Does this mean we

Re: [f2fs-dev] [PATCH 4/4] f2fs: should check the type of end_io after pullback by fscrypto

2018-07-09 Thread Chao Yu
On 2018/7/7 5:09, Jaegeuk Kim wrote: > This fixes to get the page type after pullback by fscrypto, since the original > page is bounce page but we should need to get control page which is what we > originally submitted. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/data.c | 5 ++--- > 1 file

Re: [f2fs-dev] [PATCH 3/4] f2fs: indicate shutdown f2fs to allow unmount successfully

2018-07-09 Thread Chao Yu
On 2018/7/7 5:09, Jaegeuk Kim wrote: > Once we shutdown f2fs, we have to flush stale pages in order to unmount > the system. In order to make stable, we need to stop fault injection as well. > > Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks,

Re: [f2fs-dev] [PATCH 2/4] f2fs: allow wrong configure dio to buffered write

2018-07-09 Thread Chao Yu
On 2018/7/7 5:09, Jaegeuk Kim wrote: > This fixes to support unaligned dio as buffered writes. Should we return -EINVAL as manual of write said: EINVAL fd is attached to an object which is unsuitable for writing; or the file was opened with the O_DIRECT flag, and either the address specified

Re: [f2fs-dev] [PATCH 1/4] f2fs: flush journal nat entries for nat_bits during unmount

2018-07-09 Thread Chao Yu
On 2018/7/7 5:09, Jaegeuk Kim wrote: > Let's flush journal nat entries for speed up in the next run. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/node.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > index 29237aeca041..0f076fb0d828 100644 >