Re: [f2fs-dev] [PATCH] f2fs: add F2FS_IOC_TRIM_FILE ioctl

2020-06-08 Thread Daeho Jeong
Yes, I agree with you about each vendor has different implementation on discard. So, we might be gonna use the combination of zeroing and send discards for a more secure solution. :) I think we still need a discard interface to unmap from the mapping table of the storage device side. Thanks, 2020

Re: [f2fs-dev] [PATCH] f2fs: add F2FS_IOC_TRIM_FILE ioctl

2020-06-08 Thread Chao Yu
On 2020/6/8 15:19, Daeho Jeong wrote: > Yes, I agree with you about each vendor has different implementation on > discard. > So, we might be gonna use the combination of zeroing and send discards > for a more > secure solution. :) IIRC, current solution is: - pin file - get all block addresses o

Re: [f2fs-dev] [PATCH 2/2 v2] f2fs: attach IO flags to the missing cases

2020-06-08 Thread Chao Yu
Jaegeuk, This patch should be applied before "f2fs: attach IO flags to the missing cases", otherwise, gcc may complain about implicit declaration of "__attach_io_flag". On 2020/6/8 10:51, Jaegeuk Kim wrote: > This patch adds another way to attach bio flags to node writes. > > Description: Giv

[f2fs-dev] [PATCH v2] f2fs: allow writeback on error status filesystem

2020-06-08 Thread Chao Yu
71.07% 0.01% kworker/u256:1+ [kernel.kallsyms] [k] wb_writeback | --71.06%--wb_writeback | |--68.96%--__writeback_inodes_wb | | | --68.95%--writeback_sb

[f2fs-dev] [PATCH 2/2] f2fs: remove unused parameter of f2fs_put_rpages_mapping()

2020-06-08 Thread Chao Yu
Just cleanup, no logic change. Signed-off-by: Chao Yu --- fs/f2fs/compress.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index a53578a89211..1e02a8c106b0 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -89,8 +89,7

[f2fs-dev] [PATCH 1/2] f2fs: handle readonly filesystem in f2fs_ioc_shutdown()

2020-06-08 Thread Chao Yu
If mountpoint is readonly, we should allow shutdowning filesystem successfully, this fixes issue found by generic/599 testcase of xfstest. Signed-off-by: Chao Yu --- fs/f2fs/file.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index b

Re: [f2fs-dev] [PATCH] f2fs: add F2FS_IOC_TRIM_FILE ioctl

2020-06-08 Thread Daeho Jeong
> >> Since spec didn't restrict how vendor implement the erase interface, so > >> in order to enhance performance of discard interface, vendor could > >> implement > >> it as an async one, which may not zero mapping entry(L1 table), instead, it > >> could set related bitmap to invalid that mapping

Re: [f2fs-dev] [PATCH 2/2 v2] f2fs: attach IO flags to the missing cases

2020-06-08 Thread Jaegeuk Kim
On 06/08, Chao Yu wrote: > Jaegeuk, > > This patch should be applied before "f2fs: attach IO flags to the missing > cases", > otherwise, gcc may complain about implicit declaration of "__attach_io_flag". Yup. Done. :P > > On 2020/6/8 10:51, Jaegeuk Kim wrote: > > This patch adds another way to

Re: [f2fs-dev] [PATCH] f2fs: add F2FS_IOC_TRIM_FILE ioctl

2020-06-08 Thread Jaegeuk Kim
On 06/08, Chao Yu wrote: > On 2020/6/8 15:19, Daeho Jeong wrote: > > Yes, I agree with you about each vendor has different implementation on > > discard. > > So, we might be gonna use the combination of zeroing and send discards > > for a more > > secure solution. :) > > IIRC, current solution is

Re: [f2fs-dev] [PATCH 0/2] a couple documentation fixes

2020-06-08 Thread Jonathan Corbet
On Wed, 3 Jun 2020 00:38:12 +0200 Mauro Carvalho Chehab wrote: > It follows a couple of fixes for two tables that got broken, probably due to > some conflict between the ReST conversion patches and ungoing updates. > > IMO, it would be nice to have those two applied during the merge window, > a

[f2fs-dev] [PATCH v2] f2fs: use kfree() instead of kvfree() to free superblock data

2020-06-08 Thread Denis Efremov
Use kfree() instead of kvfree() to free super in read_raw_super_block() because the memory is allocated with kzalloc() in the function. Use kfree() instead of kvfree() to free sbi in f2fs_fill_super() and f2fs_put_super() because the memory is allocated with kzalloc(). Fixes: 5222595d093e ("f2fs:

[f2fs-dev] [PATCH] libf2fs: fix build error on Windows

2020-06-08 Thread Jaegeuk Kim
Windows doesn't support S_ISREG, so let's avoid depedency. Signed-off-by: Jaegeuk Kim --- include/f2fs_fs.h | 4 lib/libf2fs.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 265f50c..709bfd8 100644 --- a/include/f2fs_

Re: [f2fs-dev] [PATCH] f2fs: add F2FS_IOC_TRIM_FILE ioctl

2020-06-08 Thread Chao Yu
On 2020/6/8 20:44, Daeho Jeong wrote: Since spec didn't restrict how vendor implement the erase interface, so in order to enhance performance of discard interface, vendor could implement it as an async one, which may not zero mapping entry(L1 table), instead, it could set

Re: [f2fs-dev] [PATCH] f2fs: add F2FS_IOC_TRIM_FILE ioctl

2020-06-08 Thread Chao Yu
On 2020/6/8 21:07, Jaegeuk Kim wrote: > On 06/08, Chao Yu wrote: >> On 2020/6/8 15:19, Daeho Jeong wrote: >>> Yes, I agree with you about each vendor has different implementation on >>> discard. >>> So, we might be gonna use the combination of zeroing and send discards >>> for a more >>> secure so

Re: [f2fs-dev] [PATCH v2] f2fs: use kfree() instead of kvfree() to free superblock data

2020-06-08 Thread Chao Yu
Hello Denis, On 2020/6/8 23:41, Denis Efremov wrote: > Use kfree() instead of kvfree() to free super in read_raw_super_block() > because the memory is allocated with kzalloc() in the function. > Use kfree() instead of kvfree() to free sbi in f2fs_fill_super() and > f2fs_put_super() because the mem

Re: [f2fs-dev] [PATCH] f2fs: add F2FS_IOC_TRIM_FILE ioctl

2020-06-08 Thread Daeho Jeong
Like the discussion, I'll add a flag to select discard and/or zero out. We need to send the discard first between those, because we'll send the discard to a zero-ed new block, if we zero out first. 2020년 6월 9일 (화) 오전 10:16, Chao Yu 님이 작성: > > On 2020/6/8 21:07, Jaegeuk Kim wrote: > > On 06/08, Cha

Re: [f2fs-dev] [PATCH v2] f2fs: don't return vmalloc() memory from f2fs_kmalloc()

2020-06-08 Thread Chao Yu
On 2020/6/5 12:57, Eric Biggers wrote: > From: Eric Biggers > > kmalloc() returns kmalloc'ed memory, and kvmalloc() returns either > kmalloc'ed or vmalloc'ed memory. But the f2fs wrappers, f2fs_kmalloc() > and f2fs_kvmalloc(), both return both kinds of memory. > > It's redundant to have two fun

Re: [f2fs-dev] [PATCH v2] f2fs: don't return vmalloc() memory from f2fs_kmalloc()

2020-06-08 Thread Eric Biggers
On Tue, Jun 09, 2020 at 09:36:50AM +0800, Chao Yu wrote: > On 2020/6/5 12:57, Eric Biggers wrote: > > From: Eric Biggers > > > > kmalloc() returns kmalloc'ed memory, and kvmalloc() returns either > > kmalloc'ed or vmalloc'ed memory. But the f2fs wrappers, f2fs_kmalloc() > > and f2fs_kvmalloc(),

Re: [f2fs-dev] [PATCH v2] f2fs: don't return vmalloc() memory from f2fs_kmalloc()

2020-06-08 Thread Chao Yu
On 2020/6/9 10:11, Eric Biggers wrote: > On Tue, Jun 09, 2020 at 09:36:50AM +0800, Chao Yu wrote: >> On 2020/6/5 12:57, Eric Biggers wrote: >>> From: Eric Biggers >>> >>> kmalloc() returns kmalloc'ed memory, and kvmalloc() returns either >>> kmalloc'ed or vmalloc'ed memory. But the f2fs wrappers,

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

2020-06-08 Thread Daeho Jeong
From: Daeho Jeong Added a new ioctl to send discard commands or/and zero out to whole data area of a regular file for security reason. Signed-off-by: Daeho Jeong --- fs/f2fs/f2fs.h | 8 +++ fs/f2fs/file.c | 149 + 2 files changed, 157 insertion

Re: [f2fs-dev] [PATCH v2] f2fs: allow writeback on error status filesystem

2020-06-08 Thread Chao Yu
Jaegeuk, Let's consider this patch in next Linux version. BTW, do you still encounter consistency problem w/o this version? On 2020/6/8 20:01, Chao Yu wrote: > 71.07% 0.01% kworker/u256:1+ [kernel.kallsyms] [k] wb_writeback > | > --71.06%--wb_writeback >