Re: [f2fs-dev] [PATCH 1/5] f2fs: fix to wait page writeback before update

2020-06-18 Thread Chao Yu
On 2020/6/19 13:49, Jaegeuk Kim wrote: > On 06/19, Chao Yu wrote: >> Hi Jaegeuk, >> >> On 2020/6/19 7:59, Jaegeuk Kim wrote: >>> Hi Chao, >>> >>> On 06/18, Chao Yu wrote: to make page content stable for special device like raid. >>> >>> Could you elaborate the problem a bit? >> >> Some devices

Re: [f2fs-dev] [PATCH 3/4] f2fs: add inline encryption support

2020-06-18 Thread Chao Yu
On 2020/6/19 12:20, Eric Biggers wrote: > On Fri, Jun 19, 2020 at 10:39:34AM +0800, Chao Yu wrote: >> Hi Eric, >> >> On 2020/6/19 2:13, Eric Biggers wrote: >>> Hi Chao, >>> >>> On Thu, Jun 18, 2020 at 06:06:02PM +0800, Chao Yu wrote: > @@ -936,8 +972,11 @@ void f2fs_submit_page_write(struct f2f

[f2fs-dev] [PATCH v2] f2fs-tools: introduce set_node_footer to initialize node footer

2020-06-18 Thread zhaowuyun--- via Linux-f2fs-devel
From: Wuyun Zhao the filesystem will use the cold flag, so deal with it to avoid potential issue of inconsistency Signed-off-by: Wuyun Zhao --- fsck/dir.c | 6 +- fsck/node.c| 9 + include/f2fs_fs.h | 20 mkfs/f2fs_format.c | 14 +

Re: [f2fs-dev] [PATCH 3/5] f2fs: shrink node_write lock coverage

2020-06-18 Thread Jaegeuk Kim
On 06/18, Chao Yu wrote: > - to avoid race between checkpoint and quota file writeback, it > just needs to hold read lock of node_write in writeback path. > - node_write lock has covered all LFS data write paths, it's not > necessary, we only need to hold node_write lock at write path of > quota fi

Re: [f2fs-dev] [PATCH 1/5] f2fs: fix to wait page writeback before update

2020-06-18 Thread Jaegeuk Kim
On 06/19, Chao Yu wrote: > Hi Jaegeuk, > > On 2020/6/19 7:59, Jaegeuk Kim wrote: > > Hi Chao, > > > > On 06/18, Chao Yu wrote: > >> to make page content stable for special device like raid. > > > > Could you elaborate the problem a bit? > > Some devices like raid5 wants page content to be stabl

Re: [f2fs-dev] [PATCH] f2fs: fix to document reserved special compression extension

2020-06-18 Thread Jaegeuk Kim
On 06/19, Chao Yu wrote: > There is one reserved special compression extension: '*', which > could be set via 'compress_extension="*"' mount option to enable > compression for all files. Thank you for the patch. :) > > Signed-off-by: Chao Yu > --- > Documentation/filesystems/f2fs.rst | 2 ++ >

Re: [f2fs-dev] [PATCH 3/4] f2fs: add inline encryption support

2020-06-18 Thread Eric Biggers
On Fri, Jun 19, 2020 at 10:39:34AM +0800, Chao Yu wrote: > Hi Eric, > > On 2020/6/19 2:13, Eric Biggers wrote: > > Hi Chao, > > > > On Thu, Jun 18, 2020 at 06:06:02PM +0800, Chao Yu wrote: > >>> @@ -936,8 +972,11 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio) > >>> > >>> inc_page_co

[f2fs-dev] [PATCH] f2fs: fix to document reserved special compression extension

2020-06-18 Thread Chao Yu
There is one reserved special compression extension: '*', which could be set via 'compress_extension="*"' mount option to enable compression for all files. Signed-off-by: Chao Yu --- Documentation/filesystems/f2fs.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/filesystem

Re: [f2fs-dev] 回复: [PATCH] f2fs-tools: set cold flag for non-dir node

2020-06-18 Thread Chao Yu
On 2020/6/19 10:21, Zac wrote: >> On 2020/6/18 20:48, zhaowu...@wingtech.com wrote: >>> From: Wuyun Zhao >> >> Thanks for the patch. :) >> >> Please add commit message here. > > OK > >>> >>> Signed-off-by: Wuyun Zhao >>> --- >>> fsck/dir.c | 1 + >>> fsck/node.c | 1 + >>> fsck/node.h | 11

Re: [f2fs-dev] [PATCH 3/4] f2fs: add inline encryption support

2020-06-18 Thread Chao Yu
On 2020/6/19 3:28, Jaegeuk Kim wrote: > On 06/18, Eric Biggers wrote: >> Hi Chao, >> >> On Thu, Jun 18, 2020 at 06:06:02PM +0800, Chao Yu wrote: @@ -936,8 +972,11 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio) inc_page_count(sbi, WB_DATA_TYPE(bio_page)); -

Re: [f2fs-dev] [PATCH 3/4] f2fs: add inline encryption support

2020-06-18 Thread Chao Yu
Hi Eric, On 2020/6/19 2:13, Eric Biggers wrote: > Hi Chao, > > On Thu, Jun 18, 2020 at 06:06:02PM +0800, Chao Yu wrote: >>> @@ -936,8 +972,11 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio) >>> >>> inc_page_count(sbi, WB_DATA_TYPE(bio_page)); >>> >>> - if (io->bio && !io_is_mer

[f2fs-dev] 回复: [PATCH] f2fs-tools: set cold flag for non-dir node

2020-06-18 Thread Zac via Linux-f2fs-devel
> On 2020/6/18 20:48, zhaowu...@wingtech.com wrote: > > From: Wuyun Zhao > > Thanks for the patch. :) > > Please add commit message here. OK > > > > Signed-off-by: Wuyun Zhao > > --- > > fsck/dir.c | 1 + > > fsck/node.c | 1 + > > fsck/node.h | 11 +++ > > 3 files changed, 13 ins

Re: [f2fs-dev] [PATCH 1/5] f2fs: fix to wait page writeback before update

2020-06-18 Thread Chao Yu
Hi Jaegeuk, On 2020/6/19 7:59, Jaegeuk Kim wrote: > Hi Chao, > > On 06/18, Chao Yu wrote: >> to make page content stable for special device like raid. > > Could you elaborate the problem a bit? Some devices like raid5 wants page content to be stable, because it will calculate parity info based

Re: [f2fs-dev] [PATCH] f2fs-tools: set cold flag for non-dir node

2020-06-18 Thread Chao Yu
On 2020/6/18 20:48, zhaowu...@wingtech.com wrote: > From: Wuyun Zhao Thanks for the patch. :) Please add commit message here. > > Signed-off-by: Wuyun Zhao > --- > fsck/dir.c | 1 + > fsck/node.c | 1 + > fsck/node.h | 11 +++ > 3 files changed, 13 insertions(+) > > diff --git a/

Re: [f2fs-dev] [PATCH 1/5] f2fs: fix to wait page writeback before update

2020-06-18 Thread Jaegeuk Kim
Hi Chao, On 06/18, Chao Yu wrote: > to make page content stable for special device like raid. Could you elaborate the problem a bit? > > Signed-off-by: Chao Yu > --- > fs/f2fs/dir.c | 2 ++ > fs/f2fs/extent_cache.c | 18 +- > fs/f2fs/f2fs.h | 2 +- > fs/f2fs

Re: [f2fs-dev] [PATCH 3/4] f2fs: add inline encryption support

2020-06-18 Thread Eric Biggers
On Wed, Jun 17, 2020 at 07:57:31AM +, Satya Tangirala wrote: > Wire up f2fs to support inline encryption via the helper functions which > fs/crypto/ now provides. This includes: > > - Adding a mount option 'inlinecrypt' which enables inline encryption > on encrypted files where it can be us

Re: [f2fs-dev] [PATCH 3/4] f2fs: add inline encryption support

2020-06-18 Thread Eric Biggers
On Thu, Jun 18, 2020 at 12:28:04PM -0700, Jaegeuk Kim wrote: > > > > It would be helpful if there was an f2fs mount option to auto-enable > > compression > > on all files (similar to how test_dummy_encryption auto-enables encryption > > on > > all files) so that it could be tested more easily. >

Re: [f2fs-dev] [PATCH 3/4] f2fs: add inline encryption support

2020-06-18 Thread Jaegeuk Kim
On 06/18, Eric Biggers wrote: > Hi Chao, > > On Thu, Jun 18, 2020 at 06:06:02PM +0800, Chao Yu wrote: > > > @@ -936,8 +972,11 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio) > > > > > > inc_page_count(sbi, WB_DATA_TYPE(bio_page)); > > > > > > - if (io->bio && !io_is_mergeable(sbi, i

Re: [f2fs-dev] [PATCH 3/4] f2fs: add inline encryption support

2020-06-18 Thread Eric Biggers
Hi Chao, On Thu, Jun 18, 2020 at 06:06:02PM +0800, Chao Yu wrote: > > @@ -936,8 +972,11 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio) > > > > inc_page_count(sbi, WB_DATA_TYPE(bio_page)); > > > > - if (io->bio && !io_is_mergeable(sbi, io->bio, io, fio, > > - i

Re: [f2fs-dev] [PATCH 2/4] fscrypt: add inline encryption support

2020-06-18 Thread Eric Biggers
A few nits: On Wed, Jun 17, 2020 at 07:57:30AM +, Satya Tangirala wrote: > To use inline encryption, the filesystem needs to be mounted with > '-o inlinecrypt'. The contents of any encrypted files will then be > encrypted using blk-crypto, instead of using the traditional > filesystem-layer c

Re: [f2fs-dev] [PATCH 0/4] Inline Encryption Support for fscrypt

2020-06-18 Thread Eric Biggers
On Wed, Jun 17, 2020 at 07:57:28AM +, Satya Tangirala wrote: > This patch series adds support for Inline Encryption to fscrypt, f2fs > and ext4. It builds on the inline encryption support now present in > the block layer, and has been rebased on v5.8-rc1. > > Patch 1 introduces the SB_INLINECR

Re: [f2fs-dev] [Cluster-devel] [PATCH v11 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-06-18 Thread Andreas Gruenbacher
On Thu, Jun 18, 2020 at 5:03 PM Matthew Wilcox wrote: > > On Thu, Jun 18, 2020 at 02:46:03PM +0200, Andreas Gruenbacher wrote: > > On Wed, Jun 17, 2020 at 4:22 AM Matthew Wilcox wrote: > > > On Wed, Jun 17, 2020 at 02:57:14AM +0200, Andreas Grünbacher wrote: > > > > Right, the approach from the

Re: [f2fs-dev] [Cluster-devel] [PATCH v11 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-06-18 Thread Matthew Wilcox
On Thu, Jun 18, 2020 at 02:46:03PM +0200, Andreas Gruenbacher wrote: > On Wed, Jun 17, 2020 at 4:22 AM Matthew Wilcox wrote: > > On Wed, Jun 17, 2020 at 02:57:14AM +0200, Andreas Grünbacher wrote: > > > Right, the approach from the following thread might fix this: > > > > > > https://lore.kernel.o

Re: [f2fs-dev] mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page

2020-06-18 Thread Yafang Shao
On Thu, Jun 18, 2020 at 8:37 PM Chris Down wrote: > > Yafang Shao writes: > >On Thu, Jun 18, 2020 at 5:09 AM Chris Down wrote: > >> > >> Naresh Kamboju writes: > >> >After this patch applied the reported issue got fixed. > >> > >> Great! Thank you Naresh and Michal for helping to get to the botto

[f2fs-dev] [PATCH v4] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-18 Thread Daeho Jeong
From: Daeho Jeong Added a new ioctl to send discard commands or/and zero out to selected data area of a regular file for security reason. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu --- fs/f2fs/f2fs.h | 15 + fs/f2fs/file.c | 179 + 2 f

Re: [f2fs-dev] mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page

2020-06-18 Thread Chris Down
Michal Hocko writes: I would really prefer to do that work on top of the fixes we (used to) have in mmotm (with the fixup). Oh, for sure. We should reintroduce the patches with the fix, and then look at longer-term solutions once that's in :-) ___

[f2fs-dev] [PATCH] f2fs-tools: set cold flag for non-dir node

2020-06-18 Thread zhaowuyun--- via Linux-f2fs-devel
From: Wuyun Zhao Signed-off-by: Wuyun Zhao --- fsck/dir.c | 1 + fsck/node.c | 1 + fsck/node.h | 11 +++ 3 files changed, 13 insertions(+) diff --git a/fsck/dir.c b/fsck/dir.c index 5f4f75e..dc03c98 100644 --- a/fsck/dir.c +++ b/fsck/dir.c @@ -522,6 +522,7 @@ static void init_inode

Re: [f2fs-dev] [Cluster-devel] [PATCH v11 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-06-18 Thread Andreas Gruenbacher
On Wed, Jun 17, 2020 at 4:22 AM Matthew Wilcox wrote: > On Wed, Jun 17, 2020 at 02:57:14AM +0200, Andreas Grünbacher wrote: > > Am Mi., 17. Juni 2020 um 02:33 Uhr schrieb Matthew Wilcox > > : > > > > > > On Wed, Jun 17, 2020 at 12:36:13AM +0200, Andreas Gruenbacher wrote: > > > > Am Mi., 15. Apr.

Re: [f2fs-dev] mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page

2020-06-18 Thread Michal Hocko
On Thu 18-06-20 13:37:43, Chris Down wrote: > Yafang Shao writes: > > On Thu, Jun 18, 2020 at 5:09 AM Chris Down wrote: > > > > > > Naresh Kamboju writes: > > > >After this patch applied the reported issue got fixed. > > > > > > Great! Thank you Naresh and Michal for helping to get to the bottom

Re: [f2fs-dev] mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page

2020-06-18 Thread Chris Down
Yafang Shao writes: On Thu, Jun 18, 2020 at 5:09 AM Chris Down wrote: Naresh Kamboju writes: >After this patch applied the reported issue got fixed. Great! Thank you Naresh and Michal for helping to get to the bottom of this :-) I'll send out a new version tomorrow with the fixes applied and

[f2fs-dev] 回复: 回复: 回复: [PATCH] f2fs: fix a race condition between f2fs_write_end_io and f2fs_del_fsync_node_entry

2020-06-18 Thread Zac via Linux-f2fs-devel
> On 2020/6/18 11:28, Zac wrote: > >> On 2020/6/18 10:39, Zac wrote: > >>> > On 2020/6/17 17:04, zhaowu...@wingtech.com wrote: > > From: Wuyun Zhao > > > > Under some condition, the __write_node_page will submit a page > which > >> is > not > > f2fs_in_warm_node_list and

Re: [f2fs-dev] [PATCH 3/4] f2fs: add inline encryption support

2020-06-18 Thread Chao Yu
On 2020/6/17 15:57, Satya Tangirala wrote: > Wire up f2fs to support inline encryption via the helper functions which > fs/crypto/ now provides. This includes: > > - Adding a mount option 'inlinecrypt' which enables inline encryption > on encrypted files where it can be used. > > - Setting the

Re: [f2fs-dev] [PATCH] fsck: prevent buffer overrun in quota code

2020-06-18 Thread Chao Yu
On 2020/6/17 7:42, Jaegeuk Kim wrote: > From: Robin Hsu > > A maliciously corrupted file systems can trigger buffer overruns in > the quota code used by fsck. > > To fix it, quota file sizes are checked against real allocated > block index tables (inode, direct nodes, indirect nodes, double > in

Re: [f2fs-dev] 回复: 回复: [PATCH] f2fs: fix a race condition between f2fs_write_end_io and f2fs_del_fsync_node_entry

2020-06-18 Thread Chao Yu
On 2020/6/18 11:28, Zac wrote: >> On 2020/6/18 10:39, Zac wrote: >>> On 2020/6/17 17:04, zhaowu...@wingtech.com wrote: > From: Wuyun Zhao > > Under some condition, the __write_node_page will submit a page which >> is not > f2fs_in_warm_node_list and will not call f2fs_add

Re: [f2fs-dev] [PATCH] f2fs: use kfree() to free variables allocated by match_strdup()

2020-06-18 Thread Chao Yu
On 2020/6/17 20:30, Wang Xiaojun wrote: > Use kfree() instead of kvfree() to free variables allocated > by match_strdup(). Because the memory is allocated with kmalloc > inside match_strdup(). > > Signed-off-by: Wang Xiaojun Reviewed-by: Chao Yu Thanks, __

Re: [f2fs-dev] [PATCH v3] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-18 Thread Chao Yu
On 2020/6/17 5:54, Daeho Jeong wrote: > From: Daeho Jeong > > Added a new ioctl to send discard commands or/and zero out > to selected data area of a regular file for security reason. > > Signed-off-by: Daeho Jeong > --- > fs/f2fs/f2fs.h | 15 + > fs/f2fs/file.c | 179

Re: [f2fs-dev] [PATCH v2] f2fs: get the right gc victim section when section has several segments

2020-06-18 Thread Chao Yu
On 2020/6/18 12:37, Jack Qiu wrote: > Assume each section has 4 segment: > .___. > |_Segment0_|_..._|_Segment3_| > . . > . . > .__. > |_section0_| > > Segment 0~2 has 0 valid block, segment 3 ha