Re: [f2fs-dev] [PATCH] fsck.f2fs: fix to skip repairing initialized i_gc_failures

2018-11-26 Thread Chao Yu
On 2018/11/27 11:52, Jaegeuk Kim wrote: > On 11/27, Chao Yu wrote: >> On 2018/11/27 8:04, Jaegeuk Kim wrote: >>> On 11/26, Chao Yu wrote: From: Chao Yu As Michael reported: after updating to f2fs-tools 1.12.0, a routine fsck of my file systems took quite a while and o

Re: [f2fs-dev] [PATCH] fsck.f2fs: fix to skip repairing initialized i_gc_failures

2018-11-26 Thread Jaegeuk Kim
On 11/27, Chao Yu wrote: > On 2018/11/27 8:04, Jaegeuk Kim wrote: > > On 11/26, Chao Yu wrote: > >> From: Chao Yu > >> > >> As Michael reported: > >> > >> after updating to f2fs-tools 1.12.0, a routine fsck of my file systems > >> took quite a while and output ten-thousands instances of the follow

Re: [f2fs-dev] [PATCH] f2fs: read page index before freeing

2018-11-26 Thread PanBian
On Tue, Nov 27, 2018 at 11:12:40AM +0800, Chao Yu wrote: > On 2018/11/27 8:22, PanBian wrote: > > On Mon, Nov 26, 2018 at 07:07:08PM +0800, Chao Yu wrote: > >> On 2018/11/26 18:28, PanBian wrote: > >>> On Mon, Nov 26, 2018 at 05:13:53PM +0800, Chao Yu wrote: > Hi Pan, > > On 2018/11/

Re: [f2fs-dev] [PATCH v2] f2fs: fix m_may_create to make OPU DIO write correctly

2018-11-26 Thread Chao Yu
Ping, On 2018/11/20 19:58, Chao Yu wrote: > On 2018-11-20 4:29, Jia Zhu wrote: >> Previously, we added a parameter @map.m_may_create to trigger OPU >> allocation and call f2fs_balance_fs() correctly. >> >> But in get_more_blocks(), @create has been overwritten by below code. >> So the function f2f

Re: [f2fs-dev] [PATCH] f2fs: read page index before freeing

2018-11-26 Thread Chao Yu
On 2018/11/27 8:22, PanBian wrote: > On Mon, Nov 26, 2018 at 07:07:08PM +0800, Chao Yu wrote: >> On 2018/11/26 18:28, PanBian wrote: >>> On Mon, Nov 26, 2018 at 05:13:53PM +0800, Chao Yu wrote: Hi Pan, On 2018/11/22 18:58, Pan Bian wrote: > The function truncate_node frees the pa

Re: [f2fs-dev] [PATCH] fsck.f2fs: fix to skip repairing initialized i_gc_failures

2018-11-26 Thread Chao Yu
On 2018/11/27 8:04, Jaegeuk Kim wrote: > On 11/26, Chao Yu wrote: >> From: Chao Yu >> >> As Michael reported: >> >> after updating to f2fs-tools 1.12.0, a routine fsck of my file systems >> took quite a while and output ten-thousands instances of the following >> line: >> >>> [FIX] (fsck_chk_inode

Re: [f2fs-dev] [PATCH 5/7] ext4: use IS_VERITY() to check inode's fsverity status

2018-11-26 Thread Chandan Rajendra
On Monday, November 26, 2018 11:06:15 PM IST Theodore Y. Ts'o wrote: > On Mon, Nov 19, 2018 at 10:53:22AM +0530, Chandan Rajendra wrote: > > This commit now uses IS_VERITY() macro to check if fsverity is > > enabled on an inode. > > > > Signed-off-by: Chandan Rajendra > > This patch causes a mas

Re: [f2fs-dev] [PATCH v2] f2fs: fix sbi->extent_list corruption issue

2018-11-26 Thread Chao Yu
On 2018/11/27 8:30, Jaegeuk Kim wrote: > On 11/26, Sahitya Tummala wrote: >> When there is a failure in f2fs_fill_super() after/during >> the recovery of fsync'd nodes, it frees the current sbi and >> retries again. This time the mount is successful, but the files >> that got recovered before retry

Re: [f2fs-dev] [PATCH 7/7] fsverity: Remove filesystem specific build config option

2018-11-26 Thread Eric Biggers
Hi Chandan, On Mon, Nov 19, 2018 at 10:53:24AM +0530, Chandan Rajendra wrote: > In order to have a common code base for fsverity "post read" processing > for all filesystems which support per-file verity, this commit removes > filesystem specific build config option (e.g. CONFIG_EXT4_FS_VERITY) an

Re: [f2fs-dev] [PATCH v2] f2fs: fix to update new block address correctly for OPU

2018-11-26 Thread Jaegeuk Kim
Hi Jia, On 11/27, Jia Zhu wrote: > Previously, we allocated a new block address for OPU mode in direct_IO. > > But the new address couldn't be assigned to @map->m_pblk correctly. > > This patch fix it. > > Fixes: 511f52d02f05 ('f2fs: allow out-place-update for direct IO in LFS mode') I've mark

Re: [f2fs-dev] [PATCH 6/7] f2fs: use IS_VERITY() to check inode's fsverity status

2018-11-26 Thread Eric Biggers
Hi Chandan, On Mon, Nov 19, 2018 at 10:53:23AM +0530, Chandan Rajendra wrote: > This commit now uses IS_VERITY() macro to check if fsverity is > enabled on an inode. > > Signed-off-by: Chandan Rajendra > --- > fs/f2fs/file.c | 6 +++--- > fs/f2fs/inode.c | 4 +++- > 2 files changed, 6 insertio

Re: [f2fs-dev] [PATCH 1/7] ext4: use IS_ENCRYPTED() to check encryption status

2018-11-26 Thread Eric Biggers
Hi Chandan, On Mon, Nov 19, 2018 at 10:53:18AM +0530, Chandan Rajendra wrote: > @@ -4724,7 +4724,7 @@ static bool ext4_should_use_dax(struct inode *inode) > return false; > if (ext4_has_inline_data(inode)) > return false; > - if (ext4_encrypted_inode(inode)) >

Re: [f2fs-dev] [PATCH v2] f2fs: fix sbi->extent_list corruption issue

2018-11-26 Thread Jaegeuk Kim
On 11/26, Sahitya Tummala wrote: > When there is a failure in f2fs_fill_super() after/during > the recovery of fsync'd nodes, it frees the current sbi and > retries again. This time the mount is successful, but the files > that got recovered before retry, still holds the extent tree, > whose extent

Re: [f2fs-dev] [PATCH 5/7] ext4: use IS_VERITY() to check inode's fsverity status

2018-11-26 Thread Eric Biggers
On Mon, Nov 26, 2018 at 12:36:15PM -0500, Theodore Y. Ts'o wrote: > On Mon, Nov 19, 2018 at 10:53:22AM +0530, Chandan Rajendra wrote: > > This commit now uses IS_VERITY() macro to check if fsverity is > > enabled on an inode. > > > > Signed-off-by: Chandan Rajendra > > This patch causes a massiv

Re: [f2fs-dev] [PATCH 3/7] fscrypt: Remove filesystem specific build config option

2018-11-26 Thread Eric Biggers
Hi Chandan, On Mon, Nov 19, 2018 at 10:53:20AM +0530, Chandan Rajendra wrote: > In order to have a common code base for fscrypt "post read" processing > for all filesystems which support encryption, this commit removes > filesystem specific build config option (e.g. CONFIG_EXT4_FS_ENCRYPTION) > an

Re: [f2fs-dev] fsck: reset i_gc_failures from 0x1 to 0x00

2018-11-26 Thread Jaegeuk Kim
Hi Michael, On 11/26, Michael Laß wrote: > Hi, > > > Am 26.11.2018 um 15:09 schrieb Chao Yu : > > On 2018-11-26 7:09, Michael Laß wrote: > >> Hi, > >> > >> after updating to f2fs-tools 1.12.0, a routine fsck of my file systems > >> took quite a while and output ten-thousands instances of the fol

Re: [f2fs-dev] [PATCH 4/7] Add S_VERITY and IS_VERITY()

2018-11-26 Thread Eric Biggers
Hi Chandan, On Mon, Nov 19, 2018 at 10:53:21AM +0530, Chandan Rajendra wrote: > Similar to S_ENCRYPTED/IS_ENCRYPTED(), this commit adds > S_VERITY/IS_VERITY() to be able to check if a VFS inode has verity > information associated with it. > > Signed-off-by: Chandan Rajendra > --- > include/linu

Re: [f2fs-dev] [PATCH] fsck.f2fs: fix to skip repairing initialized i_gc_failures

2018-11-26 Thread Jaegeuk Kim
On 11/26, Chao Yu wrote: > From: Chao Yu > > As Michael reported: > > after updating to f2fs-tools 1.12.0, a routine fsck of my file systems > took quite a while and output ten-thousands instances of the following > line: > > > [FIX] (fsck_chk_inode_blk: 954) --> Regular: 0xXYZ reset i_gc_fail

Re: [f2fs-dev] [PATCH 2/7] f2fs: use IS_ENCRYPTED() to check encryption status

2018-11-26 Thread Jaegeuk Kim
Hi Ted, On 11/26, Theodore Y. Ts'o wrote: > On Sun, Nov 25, 2018 at 11:00:38PM -0500, Theodore Y. Ts'o wrote: > > > > It might be that the simplest way to solve things is to merge the f2fs > > dev branch up to 79c66e75720c. This will have the net effect of > > including the five patches listed a

Re: [f2fs-dev] [PATCH] f2fs: check memory boundary by insane namelen

2018-11-26 Thread Jaegeuk Kim
On 11/23, Sheng Yong wrote: > Hi, Jaegeuk and Chao, > > On 2018/11/15 15:50, Jaegeuk Kim wrote: > > If namelen is corrupted to have very long value, fill_dentries can copy > > wrong memory area. > > > Is there any scenario that could hit this corruption? Or this is triggered > by fuzzing injectio

Re: [f2fs-dev] [PATCH 5/7] ext4: use IS_VERITY() to check inode's fsverity status

2018-11-26 Thread Theodore Y. Ts'o
On Mon, Nov 19, 2018 at 10:53:22AM +0530, Chandan Rajendra wrote: > This commit now uses IS_VERITY() macro to check if fsverity is > enabled on an inode. > > Signed-off-by: Chandan Rajendra This patch causes a massive number of fsverity tests. I suspect it's due to a mismatch between the ext4's

Re: [f2fs-dev] [PATCH 2/7] f2fs: use IS_ENCRYPTED() to check encryption status

2018-11-26 Thread Theodore Y. Ts'o
On Sun, Nov 25, 2018 at 11:00:38PM -0500, Theodore Y. Ts'o wrote: > > It might be that the simplest way to solve things is to merge the f2fs > dev branch up to 79c66e75720c. This will have the net effect of > including the five patches listed above onto the fscrypt git tree. So > long you don't

Re: [f2fs-dev] fsck: reset i_gc_failures from 0x1 to 0x00

2018-11-26 Thread Michael Laß
Hi, > Am 26.11.2018 um 15:09 schrieb Chao Yu : > On 2018-11-26 7:09, Michael Laß wrote: >> Hi, >> >> after updating to f2fs-tools 1.12.0, a routine fsck of my file systems >> took quite a while and output ten-thousands instances of the following >> line: >> >>> [FIX] (fsck_chk_inode_blk: 954) -

[f2fs-dev] [PATCH] fsck.f2fs: fix to skip repairing initialized i_gc_failures

2018-11-26 Thread Chao Yu
From: Chao Yu As Michael reported: after updating to f2fs-tools 1.12.0, a routine fsck of my file systems took quite a while and output ten-thousands instances of the following line: > [FIX] (fsck_chk_inode_blk: 954) --> Regular: 0xXYZ reset i_gc_failures from > 0x1 to 0x00 In old kernel, we

Re: [f2fs-dev] fsck: reset i_gc_failures from 0x1 to 0x00

2018-11-26 Thread Chao Yu
Hi Michael, On 2018-11-26 7:09, Michael Laß wrote: > Hi, > > after updating to f2fs-tools 1.12.0, a routine fsck of my file systems > took quite a while and output ten-thousands instances of the following > line: > >> [FIX] (fsck_chk_inode_blk: 954) --> Regular: 0xXYZ reset i_gc_failures from

Re: [f2fs-dev] Bug in f2fs-tools-1.12.0

2018-11-26 Thread Chao Yu
Hi Perfect Gentleman, On 2018-11-26 21:47, Perfect Gentleman wrote: > Hi Chao > > With that patch fsck.f2fs works for  RO-partition with -f option. Thanks for your test. :) Thanks, > >  ~ $ sudo mount -o remount,ro /dev/sda1 > >  ~ $ sudo fsck.f2fs -a /dev/sda1 > Info: Fix the reported corru

Re: [f2fs-dev] Bug in f2fs-tools-1.12.0

2018-11-26 Thread Perfect Gentleman
Hi Chao With that patch fsck.f2fs works for  RO-partition with -f option.  ~ $ sudo mount -o remount,ro /dev/sda1  ~ $ sudo fsck.f2fs -a /dev/sda1 Info: Fix the reported corruption. Info: Mounted device! Info: Check FS only due to RO     Error: Failed to open the device! ~ $ sudo fsck.f2fs

[f2fs-dev] [PATCH] f2fs-tools: fix to check return value of {c, m}alloc()

2018-11-26 Thread Chao Yu
From: Chao Yu It needs to fix to handle error case of {c,m}alloc(). Signed-off-by: Chao Yu --- fsck/dump.c | 4 fsck/fsck.c | 2 ++ fsck/mount.c | 13 + lib/libf2fs.c| 4 lib/libf2fs_io.c | 4 5 files changed, 27 insertions(+) diff --git a/fsck

Re: [f2fs-dev] Bug in f2fs-tools-1.12.0

2018-11-26 Thread Chao Yu
Hi Perfect Gentleman, On 2018-11-26 19:11, Perfect Gentleman wrote: > Hi Chao > > What patch do you mean? I mean https://git.kernel.org/pub/scm/linux/kernel/git/chao/f2fs-tools.git/commit/?h=dev-test&id=a6160c3e21f43b89b49802cc4a956d1c4b65ae44 Thanks, > > Redards > > P.S. It's reply to all

Re: [f2fs-dev] Bug in f2fs-tools-1.12.0

2018-11-26 Thread Perfect Gentleman
Hi Chao What patch do you mean? Redards P.S. It's reply to all :) On 11/26/18 5:52 PM, Chao Yu wrote: Hi Perfect Gentleman, Thanks for the report. On 2018/11/25 13:24, Perfect Gentleman wrote: Hi f2fs-team, there is bug: fsck.f2fs cannot check read-only filesystem. But 1.11.0 can do that.

Re: [f2fs-dev] [PATCH] f2fs: read page index before freeing

2018-11-26 Thread Chao Yu
On 2018/11/26 18:28, PanBian wrote: > On Mon, Nov 26, 2018 at 05:13:53PM +0800, Chao Yu wrote: >> Hi Pan, >> >> On 2018/11/22 18:58, Pan Bian wrote: >>> The function truncate_node frees the page with f2fs_put_page. However, >>> the page index is read after that. So, the patch reads the index before

[f2fs-dev] [PATCH] fsck.f2fs: allow to fsck readonly image w/ -f option

2018-11-26 Thread Chao Yu
To keep line with e2fsprogs, let's allow to fsck mounted image as readonly w/ -f option. Reported-by: Perfect Gentleman Signed-off-by: Chao Yu --- fsck/main.c | 1 + include/f2fs_fs.h | 1 + lib/libf2fs.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fsck/main.

Re: [f2fs-dev] Bug in f2fs-tools-1.12.0

2018-11-26 Thread Chao Yu
Hi Perfect Gentleman, Thanks for the report. On 2018/11/25 13:24, Perfect Gentleman wrote: > Hi f2fs-team, > > there is bug: fsck.f2fs cannot check read-only filesystem. But 1.11.0 > can do that. > > fsck  |Info: Fix the reported corruption. > fsck  |Info: Mounted devic

Re: [f2fs-dev] [PATCH v2] f2fs: fix to update new block address correctly for OPU

2018-11-26 Thread Greg KH
On Tue, Nov 27, 2018 at 02:32:32AM +0800, Jia Zhu wrote: > Previously, we allocated a new block address for OPU mode in direct_IO. > > But the new address couldn't be assigned to @map->m_pblk correctly. > > This patch fix it. > > Fixes: 511f52d02f05 ('f2fs: allow out-place-update for direct IO i

Re: [f2fs-dev] [PATCH] f2fs: read page index before freeing

2018-11-26 Thread PanBian
On Mon, Nov 26, 2018 at 05:13:53PM +0800, Chao Yu wrote: > Hi Pan, > > On 2018/11/22 18:58, Pan Bian wrote: > > The function truncate_node frees the page with f2fs_put_page. However, > > the page index is read after that. So, the patch reads the index before > > freeing the page. > > I notice tha

[f2fs-dev] [PATCH v2] f2fs: fix to update new block address correctly for OPU

2018-11-26 Thread Jia Zhu
Previously, we allocated a new block address for OPU mode in direct_IO. But the new address couldn't be assigned to @map->m_pblk correctly. This patch fix it. Fixes: 511f52d02f05 ('f2fs: allow out-place-update for direct IO in LFS mode') Signed-off-by: Jia Zhu --- v2: - update commit message.

Re: [f2fs-dev] [PATCH v3 2/2] f2fs: adjust trace print in f2fs_get_victim() to cover all paths

2018-11-26 Thread Chao Yu
On 2018/11/26 16:01, Sahitya Tummala wrote: > Adjust the trace print in f2fs_get_victim() to cover GC done by > F2FS_IOC_GARBAGE_COLLECT_RANGE. > > Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux

Re: [f2fs-dev] [PATCH v3 1/2] f2fs: fix to allow node segment for GC by ioctl path

2018-11-26 Thread Chao Yu
On 2018/11/26 16:01, Sahitya Tummala wrote: > Allow node type segments also to be GC'd via f2fs ioctl > F2FS_IOC_GARBAGE_COLLECT_RANGE. > > Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-de

Re: [f2fs-dev] [PATCH] f2fs: read page index before freeing

2018-11-26 Thread Chao Yu
Hi Pan, On 2018/11/22 18:58, Pan Bian wrote: > The function truncate_node frees the page with f2fs_put_page. However, > the page index is read after that. So, the patch reads the index before > freeing the page. I notice that you found another use-after-free bug in ext4, out of curiosity, I'd lik

[f2fs-dev] [PATCH v3 2/2] f2fs: adjust trace print in f2fs_get_victim() to cover all paths

2018-11-26 Thread Sahitya Tummala
Adjust the trace print in f2fs_get_victim() to cover GC done by F2FS_IOC_GARBAGE_COLLECT_RANGE. Signed-off-by: Sahitya Tummala --- fs/f2fs/gc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index d720551..e4689c6 100644 --- a/fs/f2fs/gc.c ++

[f2fs-dev] [PATCH v3 1/2] f2fs: fix to allow node segment for GC by ioctl path

2018-11-26 Thread Sahitya Tummala
Allow node type segments also to be GC'd via f2fs ioctl F2FS_IOC_GARBAGE_COLLECT_RANGE. Signed-off-by: Sahitya Tummala --- v3: seperate the trace print change from this patch fs/f2fs/gc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index a07