[PATCH v2] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-10 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 | 143 + 2 files changed, 151

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

2020-06-11 Thread Daeho Jeong
2020년 6월 11일 (목) 오후 5:56, Chao Yu 님이 작성: > > On 2020/6/11 11:16, Daeho Jeong wrote: > > 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

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

2020-06-11 Thread Daeho Jeong
2020년 6월 12일 (금) 오전 1:27, Eric Biggers 님이 작성: > > On Thu, Jun 11, 2020 at 12:16:52PM +0900, Daeho Jeong wrote: > > + for (index = pg_start; index < pg_end;) { > > + struct dnode_of_data dn; > > + unsigned int end_offset; > > + > >

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

2020-06-11 Thread Daeho Jeong
; sectrim.blklen = 256; // 1MiB sectrim.flags = F2FS_TRIM_FILE_DISCARD | F2FS_TRIM_FILE_ZEROOUT; ret = ioctl(fd, F2FS_SEC_TRIM_FILE, §rim); 2020년 6월 12일 (금) 오전 8:00, Eric Biggers 님이 작성: > > On Fri, Jun 12, 2020 at 07:49:12AM +0900, Daeho Jeong wrote: > > 2020년 6월 12일 (금) 오전 1:27, Eric B

[PATCH] f2fs: protect new segment allocation in expand_inode_data

2020-05-26 Thread Daeho Jeong
From: Daeho Jeong Found a new segemnt allocation without f2fs_lock_op() in expand_inode_data(). So, when we do fallocate() for a pinned file and trigger checkpoint very frequently and simultaneously. F2FS gets stuck in the below code of do_checkpoint() forever. f2fs_sync_meta_pages(sbi, META

[PATCH v2] f2fs: add GC_URGENT_LOW mode in gc_urgent

2020-07-01 Thread Daeho Jeong
From: Daeho Jeong Added a new gc_urgent mode, GC_URGENT_LOW, in which mode F2FS will lower the bar of checking idle in order to process outstanding discard commands and GC a little bit aggressively. Signed-off-by: Daeho Jeong --- Documentation/ABI/testing/sysfs-fs-f2fs | 4 +++- fs/f2fs

Re: [f2fs-dev] [PATCH] f2fs: add symbolic link to kobject in sysfs

2020-07-02 Thread Daeho Jeong
Got it. Thanks~ 2020년 7월 3일 (금) 오전 11:02, Chao Yu 님이 작성: > > On 2020/7/1 20:12, Daeho Jeong wrote: > >> On 2020/7/1 15:04, Daeho Jeong wrote: > >>> Actually, I want to keep the mount number remaining to the same > >>> number, even if it's re-mounted

[PATCH v2] f2fs: add symbolic link to kobject in sysfs

2020-07-02 Thread Daeho Jeong
From: Daeho Jeong Added a symbolic link to directory of sysfs. It will create a symbolic link such as "mount_0" and "mount_1" to each f2fs mount in the order of mounting filesystem. But once one mount point was umounted, that sequential number @x in "mount_@x"

[PATCH v3] f2fs: add symbolic link to kobject in sysfs

2020-07-02 Thread Daeho Jeong
From: Daeho Jeong Added a symbolic link to directory of sysfs. It will create a symbolic link such as "mount_0" and "mount_1" to each f2fs mount in the order of mounting filesystem. But once one mount point was umounted, that sequential number @x in "mount_@x"

[PATCH] f2fs: add GC_URGENT_LOW mode in gc_urgent

2020-06-29 Thread Daeho Jeong
From: Daeho Jeong Added a new gc_urgent mode, GC_URGENT_LOW, in which mode F2FS will lower the bar of checking idle in order to process outstanding discard commands and GC a little bit aggressively. Signed-off-by: Daeho Jeong --- Documentation/ABI/testing/sysfs-fs-f2fs | 4 +++- fs/f2fs

[PATCH] f2fs: add symbolic link to kobject in sysfs

2020-06-29 Thread Daeho Jeong
From: Daeho Jeong Added a symbolic link to directory of sysfs. It will create a symbolic link such as "mount_0" and "mount_1" to each f2fs mount in the order of mounting filesystem. It will provide easy access to sysfs node even if not knowing the specific device node name

[PATCH v5] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-07-07 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 Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 15 fs/f2fs/file.c | 181

[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

Re: [PATCH v2] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE

2020-07-13 Thread Daeho Jeong
It's correct~ :) 2020년 7월 14일 (화) 오전 3:11, Jaegeuk Kim 님이 작성: > > Hi Daeho, > > Please take a look at this. > > https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev&id=35245180459aebf6d70fde88a538f0400a794aa6 > > Thanks, > > On 07

[PATCH] f2fs: fix writecount false positive in releasing compress blocks

2020-10-11 Thread Daeho Jeong
From: Daeho Jeong In current condition check, if it detects writecount, it return -EBUSY regardless of f_mode of the file. Fixed it. Signed-off-by: Daeho Jeong --- fs/f2fs/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index

[PATCH 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-12 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_SET_COMPRESS_OPTION ioctl to change file compression option of a file. Signed-off-by: Daeho Jeong --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs/file.c | 56 ++ 2 files changed, 58 insertions(+) diff --git a/fs/f2fs

[PATCH 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-12 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_GET_COMPRESS_OPTION ioctl to get file compression option of a file. Signed-off-by: Daeho Jeong --- fs/f2fs/f2fs.h | 7 +++ fs/f2fs/file.c | 30 ++ 2 files changed, 37 insertions(+) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs

Re: [PATCH] f2fs: protect new segment allocation in expand_inode_data

2020-06-03 Thread Daeho Jeong
Oh, thanks for notification! 2020년 6월 3일 (수) 오후 3:59, Chao Yu 님이 작성: > > On 2020/6/1 11:03, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Found a new segemnt allocation without f2fs_lock_op() in > > expand_inode_data(). So, when we do fallocate() for a pinned f

[PATCH] f2fs: add F2FS_IOC_TRIM_FILE ioctl

2020-06-04 Thread Daeho Jeong
From: Daeho Jeong Added a new ioctl to send discard commands to whole data area of a regular file for security reason. Signed-off-by: Daeho Jeong --- fs/f2fs/f2fs.h | 1 + fs/f2fs/file.c | 129 + 2 files changed, 130 insertions(+) diff --git

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

2020-06-07 Thread Daeho Jeong
unmap that block, I believe discard is safer than zeroing out. 2020년 6월 8일 (월) 오전 11:46, Chao Yu 님이 작성: > > On 2020/6/5 12:27, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Added a new ioctl to send discard commands to whole data area of > > a regular file for sec

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

2020-06-08 Thread Daeho Jeong
, 2020년 6월 8일 (월) 오후 3:57, Chao Yu 님이 작성: > > On 2020/6/8 11:36, Daeho Jeong wrote: > > Yes, this is for security key destruction. > > > > AFAIK, discard will unmap the data block and, after done it, > > we can read either zero data or garbage data from that block depend

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

2020-06-08 Thread Daeho Jeong
lated bitmap to invalid even in the async way, I thought there is no way to access old data using the same logical address. It's already invalidated. Have you seen any storage vendor allowing this? It's awful. 2020년 6월 8일 (월) 오후 4:43, Chao Yu 님이 작성: > > On 2020/6/8 15:19, Daeho Jeon

[PATCH] f2fs: make fibmap consistent with fiemap for compression chunk

2020-08-27 Thread Daeho Jeong
From: Daeho Jeong Currently fibmap returns zero address for compression chunk. But it is not consistent with the output of fiemap, since fiemap returns real pysical block address related to the compression chunk. Therefore I suggest fibmap returns the same output with fiemap. Signed-off-by

[PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-27 Thread Daeho Jeong
From: Daeho Jeong After releasing cblocks, the compressed file can be accidentally disabled in compression mode, since it has zero cblocks. As we are using IMMUTABLE flag to present released cblocks state, we can add IMMUTABLE state check when considering the compressed file disabling. Signed

Re: [f2fs-dev] [PATCH] f2fs: change i_compr_blocks of inode to atomic value

2020-09-02 Thread Daeho Jeong
And how about this atomic64 to just atomic? As you mentioned before, we don't need a 64bit value for i_compr_blocks of inode. 2020년 9월 3일 (목) 오전 10:08, Chao Yu 님이 작성: > > On 2020/9/2 14:29, Daeho Jeong wrote: > > From: Daeho Jeong > > > > writepages() can be conc

[PATCH v2] f2fs: change i_compr_blocks of inode to atomic value

2020-09-02 Thread Daeho Jeong
From: Daeho Jeong writepages() can be concurrently invoked for the same file by different threads such as a thread fsyncing the file and a kworker kernel thread. So, changing i_compr_blocks without protection is racy and we need to protect it by changing it with atomic type value. Plus, we don&#

[PATCH] f2fs: change i_compr_blocks of inode to atomic value

2020-09-01 Thread Daeho Jeong
From: Daeho Jeong writepages() can be concurrently invoked for the same file by different threads such as a thread fsyncing the file and a kworker kernel thread. So, changing i_compr_blocks without protection is racy and we need to protect it by changing it with atomic type value. Signed-off-by

Re: [f2fs-dev] [PATCH] f2fs: make fibmap consistent with fiemap for compression chunk

2020-08-30 Thread Daeho Jeong
I got it. Thanks~ :) 2020년 8월 30일 (일) 오전 8:44, Chao Yu 님이 작성: > > On 2020-8-28 11:49, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Currently fibmap returns zero address for compression chunk. But it > > is not consistent with the output of fiemap, since fiemap

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Daeho Jeong
Do you have any reason not to put this check here? If we do this check outside of here, we definitely make a mistake sooner or later. 2020년 8월 30일 (일) 오후 12:24, Chao Yu 님이 작성: > > On 2020-8-28 13:46, Daeho Jeong wrote: > > From: Daeho Jeong > > > > After releasing cblo

[PATCH] f2fs: add block address limit check to compressed file

2020-08-30 Thread Daeho Jeong
From: Daeho Jeong Need to add block address range check to compressed file case and avoid calling get_data_block_bmap() for compressed file. Signed-off-by: Daeho Jeong --- fs/f2fs/data.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/data.c b/fs

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Daeho Jeong
; On 2020/8/31 7:42, Daeho Jeong wrote: > > Do you have any reason not to put this check here? > > No, the place is okay to me. :) > > > If we do this check outside of here, we definitely make a mistake > > sooner or later. > > I just want to see whether we can

[PATCH] f2fs: change compr_blocks of superblock info to 64bit

2020-08-30 Thread Daeho Jeong
From: Daeho Jeong Current compr_blocks of superblock info is not 64bit value. We are accumulating each i_compr_blocks count of inodes to this value and those are 64bit values. So, need to change this to 64bit value. Signed-off-by: Daeho Jeong --- fs/f2fs/debug.c | 6 +++--- fs/f2fs/f2fs.h

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Daeho Jeong
> - open(O_RDWR) > - ioctl(FS_IOC_SETFLAGS, F2FS_COMPR_FL) > - write() > - ioctl(RELEASE_COMPRESS_BLOCKS) -- inode is immutable now > - ioctl(FS_IOC_SETFLAGS, ~F2FS_COMPR_FL) -- Should we allow to update > immutable inode? > as we know, normally, immutable inode should deny open(O_WRONLY or O_RDWR

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Daeho Jeong
I think this patch is enough for now. If you have anything else we should take care, please let me know~ 2020년 8월 31일 (월) 오후 3:08, Chao Yu 님이 작성: > > On 2020/8/31 11:55, Daeho Jeong wrote: > >> - open(O_RDWR) > >> - ioctl(FS_IOC_SETFLAGS, F2FS_COMPR_FL) >

[PATCH v3 2/2] f2fs: change return value of f2fs_disable_compressed_file to bool

2020-09-07 Thread Daeho Jeong
From: Daeho Jeong The returned integer is not required anywhere. So we need to change the return value to bool type. Signed-off-by: Daeho Jeong --- fs/f2fs/data.c | 2 +- fs/f2fs/f2fs.h | 17 ++--- fs/f2fs/file.c | 4 ++-- 3 files changed, 9 insertions(+), 14 deletions(-) diff

[PATCH v3 1/2] f2fs: change i_compr_blocks of inode to atomic value

2020-09-07 Thread Daeho Jeong
From: Daeho Jeong writepages() can be concurrently invoked for the same file by different threads such as a thread fsyncing the file and a kworker kernel thread. So, changing i_compr_blocks without protection is racy and we need to protect it by changing it with atomic type value. Plus, we don&#

[PATCH] f2fs: clean up vm_map_ram() call

2020-09-08 Thread Daeho Jeong
From: Daeho Jeong Made f2fs_vmap() wrapper to handle vm_map_ram() stuff. Signed-off-by: Daeho Jeong --- fs/f2fs/compress.c | 42 ++ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index

Re: [f2fs-dev] [PATCH 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-14 Thread Daeho Jeong
it? This is to detect any possibility of other threads mmap-ing and writing the file. Using only inode lock is not enough to prevent them from making dirty pages. 2020년 10월 13일 (화) 오후 3:11, Eric Biggers 님이 작성: > > On Tue, Oct 13, 2020 at 11:24:29AM +0900, Daeho Jeong wrote:

Re: [f2fs-dev] [PATCH 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-14 Thread Daeho Jeong
Randy, I'll talk with F2FS maintainers about this. Eric, Sure, I'll add it in the commit message. 2020년 10월 13일 (화) 오후 3:13, Eric Biggers 님이 작성: > > On Tue, Oct 13, 2020 at 11:24:28AM +0900, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Added a new F2FS_IO

Re: [f2fs-dev] [PATCH 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-15 Thread Daeho Jeong
ile descriptor (or the same file description) concurrently. Yep, I agree this is not a proper way. I think we don't need this check here, because compress routine doesn't compress any file data when it detects the file is mmaped using f2fs_is_mmap_file(). Thanks~ 2020년 10월 15일 (목) 오후

[PATCH] f2fs: add compr_inode and compr_blocks sysfs nodes

2020-10-15 Thread Daeho Jeong
From: Daeho Jeong Added compr_inode to show compressed inode count and compr_blocks to show compressed block count in sysfs. Signed-off-by: Daeho Jeong --- Documentation/ABI/testing/sysfs-fs-f2fs | 10 ++ fs/f2fs/sysfs.c | 17 + 2 files changed

[PATCH v4 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-26 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_GET_COMPRESS_OPTION ioctl to get file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scale clu

[PATCH v4 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-26 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_SET_COMPRESS_OPTION ioctl to change file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scal

Re: [f2fs-dev] [PATCH] f2fs: add compr_inode and compr_blocks sysfs nodes

2020-10-20 Thread Daeho Jeong
Both values are from memory values. 2020년 10월 21일 (수) 오후 1:36, Eric Biggers 님이 작성: > > On Fri, Oct 16, 2020 at 02:14:55PM +0900, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Added compr_inode to show compressed inode count and compr_blocks to > > show c

Re: [f2fs-dev] [PATCH v4 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-28 Thread Daeho Jeong
Chao, Do you want to print out a kernel warning message in this case? like "XX compression algorithm is set for this inode, but current mount option doesn't support this algorithm."? 2020년 10월 28일 (수) 오후 3:47, Chao Yu 님이 작성: > > On 2020/10/27 13:38, Daeho Jeong wrote:

[PATCH v5 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-29 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_SET_COMPRESS_OPTION ioctl to change file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scal

Re: [f2fs-dev] [PATCH v5 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-29 Thread Daeho Jeong
f2fs_cops is a static variable. Do you wanna change this to global variable (extern)? 2020년 10월 29일 (목) 오후 4:29, Chao Yu 님이 작성: > > On 2020/10/29 12:15, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Added a new F2FS_IOC_SET_COMPRESS_OPTION ioctl to change file > >

[PATCH v5 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-29 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_GET_COMPRESS_OPTION ioctl to get file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scale clu

Re: [f2fs-dev] [PATCH] f2fs: add compr_inode and compr_blocks sysfs nodes

2020-10-21 Thread Daeho Jeong
Yep, It sounds good to me. 2020년 10월 21일 (수) 오후 3:08, Chao Yu 님이 작성: > > On 2020/10/16 13:14, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Added compr_inode to show compressed inode count and compr_blocks to > > show compressed block count in sysfs. >

[PATCH v2 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-21 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_SET_COMPRESS_OPTION ioctl to change file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scal

[PATCH v2 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-21 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_GET_COMPRESS_OPTION ioctl to get file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scale clu

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-21 Thread Daeho Jeong
Yep, it sounds more clear~ 2020년 10월 22일 (목) 오후 1:22, Eric Biggers 님이 작성: > > On Thu, Oct 22, 2020 at 12:58:47PM +0900, Daeho Jeong wrote: > > + if (!f2fs_compressed_file(inode)) { > > + inode_unlock(inode); > > + return -EINVAL; > > +

Re: [f2fs-dev] [PATCH v2 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-21 Thread Daeho Jeong
e->i_size != 0? Ack Thanks~! 2020년 10월 22일 (목) 오후 1:26, Eric Biggers 님이 작성: > > On Thu, Oct 22, 2020 at 12:58:48PM +0900, Daeho Jeong wrote: > > diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c > > index 7895186cc765..3b58a41223f8 100644 > > --

Re: [PATCH v2 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-23 Thread Daeho Jeong
Yep, sure~! 2020년 10월 23일 (금) 오후 9:00, Dan Carpenter 님이 작성: > > Hi Daeho, > > url: > https://github.com/0day-ci/linux/commits/Daeho-Jeong/f2fs-add-F2FS_IOC_GET_COMPRESS_OPTION-ioctl/20201022-115947 > base: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git &

[PATCH v3 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-25 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_SET_COMPRESS_OPTION ioctl to change file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scal

[PATCH v3 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-25 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_GET_COMPRESS_OPTION ioctl to get file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scale clu

Re: [PATCH v3 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-26 Thread Daeho Jeong
I thought I gave the information about that in the commit message. Is this not enough for you? Actually, there is no space for F2FS ioctl documentation now. :( 2020년 10월 27일 (화) 오전 4:04, Eric Biggers 님이 작성: > > On Mon, Oct 26, 2020 at 01:16:55PM +0900, Daeho Jeong wrote: > > From:

Re: [PATCH v3 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-26 Thread Daeho Jeong
I checked that. We seem to need to complement missing parts including other ioctls in Documentation/filesystems/fscrypt.rst. Thanks~ 2020년 10월 27일 (화) 오전 8:05, Eric Biggers 님이 작성: > > On Tue, Oct 27, 2020 at 08:02:18AM +0900, Daeho Jeong wrote: > > I thought I gave the information a

Re: [PATCH v3 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-26 Thread Daeho Jeong
Oops, typos... 2020년 10월 27일 (화) 오전 8:43, Daeho Jeong 님이 작성: > > Oops, typos... > > On Tue, Oct 27, 2020 at 8:27 AM Eric Biggers wrote: >> >> On Tue, Oct 27, 2020 at 08:18:44AM +0900, Daeho Jeong wrote: >> > I checked that. We seem to need to complement missing

Re: [f2fs-dev] [PATCH v5 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-29 Thread Daeho Jeong
Chao, got it on f2fs_is_compress_algorithm_valid(). I also agree on Eric's opinion on that error value. 2020년 10월 30일 (금) 오전 12:54, Eric Biggers 님이 작성: > > On Thu, Oct 29, 2020 at 03:29:17PM +0800, Chao Yu wrote: > > > +static int f2fs_ioc_set_compress_option(struct file *filp, unsigned long > >

[PATCH v6 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-29 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_GET_COMPRESS_OPTION ioctl to get file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scale clu

[PATCH v6 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-29 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_SET_COMPRESS_OPTION ioctl to change file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scal

Re: [f2fs-dev] [PATCH v5 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-29 Thread Daeho Jeong
Opps, I missed this. We need v7... lol 2020년 10월 30일 (금) 오전 11:37, Chao Yu 님이 작성: > > On 2020/10/29 15:24, Chao Yu wrote: > > On 2020/10/29 12:15, Daeho Jeong wrote: > > >> +inode_lock(inode); > > > > It's minor, > > > > inode_lock_sha

[PATCH v7 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-29 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_SET_COMPRESS_OPTION ioctl to change file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scal

[PATCH v7 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl

2020-10-29 Thread Daeho Jeong
From: Daeho Jeong Added a new F2FS_IOC_GET_COMPRESS_OPTION ioctl to get file compression option of a file. struct f2fs_comp_option { u8 algorithm; => compression algorithm => 0:lzo, 1:lz4, 2:zstd, 3:lzorle u8 log_cluster_size; => log scale clu

Re: [f2fs-dev] [PATCH v7 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-11-01 Thread Daeho Jeong
Oh, even if those are patchset, then I have to send just changed ones? Got it. 2020년 10월 30일 (금) 오후 3:13, Chao Yu 님이 작성: > > Daeho, > > If there is no change, we are used to not resend the patch with updated > version. > > Thanks, > > On 2020/10/30 12:10, Daeho Jeong w

Re: [PATCH v3] f2fs: add symbolic link to kobject in sysfs

2020-07-08 Thread Daeho Jeong
I thought it's working for our system. But as you said, it might be not true for others. I got your point. Partition label would be a great idea for us. Thank you for your comment! 2020년 7월 8일 (수) 오후 7:05, Greg KH 님이 작성: > > On Mon, Jul 06, 2020 at 08:47:07AM +0900, Daeho Jeong wrot

[PATCH] f2fs: ignore when len of range in f2fs_sec_trim_file is zero

2020-07-08 Thread Daeho Jeong
From: Daeho Jeong When end_addr comes to zero, it'll trigger different behaviour. To prevent this, we need to ignore the case of that range.len is zero in the function. Signed-off-by: Daeho Jeong --- fs/f2fs/file.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

Re: [f2fs-dev] [PATCH] f2fs: ignore when len of range in f2fs_sec_trim_file is zero

2020-07-08 Thread Daeho Jeong
7월 9일 (목) 오후 12:05, Chao Yu 님이 작성: > > On 2020/7/9 9:57, Daeho Jeong wrote: > > From: Daeho Jeong > > > > When end_addr comes to zero, it'll trigger different behaviour. > > To prevent this, we need to ignore the case of that range.len is > > zero in th

Re: [f2fs-dev] [PATCH] f2fs: ignore when len of range in f2fs_sec_trim_file is zero

2020-07-08 Thread Daeho Jeong
I can add it~ 2020년 7월 9일 (목) 오후 2:39, Jaegeuk Kim 님이 작성: > > On 07/09, Chao Yu wrote: > > On 2020/7/9 9:57, Daeho Jeong wrote: > > > From: Daeho Jeong > > > > > > When end_addr comes to zero, it'll trigger different behaviour. > > > To preve

[PATCH] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE

2020-07-09 Thread Daeho Jeong
From: Daeho Jeong Changed the way of handling range.len of F2FS_IOC_SEC_TRIM_FILE. 1. Added -1 value support for range.len to signify the end of file. 2. If the end of the range passes over the end of file, it means until the end of file. 3. ignored the case of that range.len is zero to

Re: [f2fs-dev] [PATCH] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE

2020-07-09 Thread Daeho Jeong
you worried about the case that sudden power-off occurs while a file is being truncated? ex) 1GB file is being truncated to 4KB -> sudden power-off -> i_size(4KB), i_blocks(maybe somewhere between 4KB and 1GB) 2020년 7월 10일 (금) 오후 12:02, Jaegeuk Kim 님이 작성: > > On 07/10, Daeho Jeong wrote:

Re: [f2fs-dev] [PATCH] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE

2020-07-09 Thread Daeho Jeong
Jaegeuk Kim wrote: > > > On 07/10, Chao Yu wrote: > > >> On 2020/7/10 11:02, Jaegeuk Kim wrote: > > >>> On 07/10, Daeho Jeong wrote: > > >>>> From: Daeho Jeong > > >>>> > > >>>> Changed the way of handling ran

[PATCH 1/2] f2fs: add disable_auto_compr mount option

2020-11-16 Thread Daeho Jeong
From: Daeho Jeong We will add a new disable_auto_compr mount option to turn off the automaic compression on the compression enabled file, in order to give discretion of choosing the target file and the timing of compression to the user. Signed-off-by: Daeho Jeong --- Documentation/filesystems

[PATCH 2/2] f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE

2020-11-16 Thread Daeho Jeong
From: Daeho Jeong Added two ioctl to decompress/compress explicitly the compression enabled file in disable_auto_compr mount option. Using these two ioctls, the users can make a control of compression and decompression of their files. Signed-off-by: Daeho Jeong --- fs/f2fs/f2fs.h | 10

[PATCH v2] f2fs_io: add get/set compression option

2020-11-03 Thread Daeho Jeong
From: Daeho Jeong Added new commands, get_coption and set_coption, to support F2FS_IOC_GET_COMPRESS_OPTION and F2FS_IOC_SET_COMPRESS_OPTION. Signed-off-by: Daeho Jeong --- v2: changed the file open option of set_coption to write only. --- tools/f2fs_io/f2fs_io.c | 61

[PATCH v7] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-07-20 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. The way of handling range.len of F2FS_IOC_SEC_TRIM_FILE: 1. Added -1 value support for range.len to secure trim the whole blocks starting from range.start

Re: [f2fs-dev] [PATCH v2] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE

2020-07-14 Thread Daeho Jeong
aa6 > > I'm curious about what will happen if we call > sec_trim_file(F2FS_TRIM_FILE_ZEROOUT) on an encrypted file, will > it use zero bits covering encrypted data on disk? > > Thanks, > > > > > Thanks, > > > > On 07/13, Daeho Jeong wrote: > >&g

Re: [f2fs-dev] [PATCH v2] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE

2020-07-14 Thread Daeho Jeong
You mean we can support ZEROOUT option only for encrypted files of non-multidevice f2fs, and return -EOPNOTSUPP in the multidevice case, right now? 2020년 7월 15일 (수) 오후 3:17, Chao Yu 님이 작성: > > On 2020/7/15 12:06, Daeho Jeong wrote: > > We could use fscrypt_zeroout_range() for an en

Re: [f2fs-dev] [PATCH v2] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE

2020-07-15 Thread Daeho Jeong
Chao, I can't find fscrypt_zeroout_range_inline_crypt() function. Do you mean we need to implement this one for inline encryption? 2020년 7월 15일 (수) 오후 4:17, Chao Yu 님이 작성: > > On 2020/7/15 14:54, Daeho Jeong wrote: > > You mean we can support ZEROOUT option only for encrypted

[PATCH v2] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-07-17 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. The way of handling range.len of F2FS_IOC_SEC_TRIM_FILE: 1. Added -1 value support for range.len to secure trim the whole blocks starting from range.start

[PATCH 2/2] f2fs: add volume_name mount option

2020-07-18 Thread Daeho Jeong
From: Daeho Jeong Added "volume_name" mount option. When the volume name in the on-disk superblock doesn't exist, we can input the volume name as a mount option and this is used to create a sysfs symbolic link pointing to /sys/fs/f2fs/. The format of the symbolic directory link

[PATCH 1/2] f2fs: add sysfs symbolic link to kobject with volume name

2020-07-18 Thread Daeho Jeong
From: Daeho Jeong Added a symbolic link directory pointing to its device name directory using the volume name of the partition in sysfs. (i.e., /sys/fs/f2fs/vol_#x -> /sys/fs/f2fs/sda1) "vol" is the volume name of the partition, "#x" is the number representing the order of

Re: [PATCH v3] f2fs: add symbolic link to kobject in sysfs

2020-07-05 Thread Daeho Jeong
> No Documentation/ABI/ entry for your new sysfs file/link? This is for adding a symbolic link to a pre-existed /sys/fs/f2fs/ directory and it means /sys/fs/f2fs/ points to /sys/fs/f2fs/. I already added the description of this in Documentation/filesystems/f2fs.rst. > > And what does this help wi

[PATCH v2] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE

2020-07-12 Thread Daeho Jeong
From: Daeho Jeong Changed the way of handling range.len of F2FS_IOC_SEC_TRIM_FILE. 1. Added -1 value support for range.len to secure trim the whole blocks starting from range.start regardless of i_size. 2. If the end of the range passes over the end of file, it means until the end of

Question about STEP_DECOMPRESS_NOWQ

2020-09-08 Thread Daeho Jeong
Hi Chao, I have a question about the below flag for decompression. STEP_DECOMPRESS_NOWQ, /* handle normal cluster data inplace */ According to the comment, you added this for using inplace decompression but inplace decompression mode is not being activated now, since we are setting STE

Re: [f2fs-dev] Question about STEP_DECOMPRESS_NOWQ

2020-09-09 Thread Daeho Jeong
Got it. I misunderstood that is some residue of trying to implement softirq context decompression. :) 2020년 9월 9일 (수) 오후 4:15, Chao Yu 님이 작성: > > Hi Daeho, > > On 2020/9/9 12:43, Daeho Jeong wrote: > > Hi Chao, > > > > I have a question about th

Re: [f2fs-dev] [PATCH] f2fs: add GC_URGENT_LOW mode in gc_urgent

2020-06-30 Thread Daeho Jeong
Yes, it's correct. 2020년 7월 1일 (수) 오후 12:35, Chao Yu 님이 작성: > > On 2020/6/30 8:54, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Added a new gc_urgent mode, GC_URGENT_LOW, in which mode > > F2FS will lower the bar of checking idle in order to > > proc

Re: [f2fs-dev] [PATCH] f2fs: add symbolic link to kobject in sysfs

2020-07-01 Thread Daeho Jeong
Actually, I want to keep the mount number remaining to the same number, even if it's re-mounted. Or we need to keep track of the number being increased whenever it's remounted. :( 2020년 7월 1일 (수) 오후 3:36, Chao Yu 님이 작성: > > Hi Daeho, > > On 2020/6/30 8:56, Daeho Jeong wrote:

Re: [f2fs-dev] [PATCH] f2fs: add symbolic link to kobject in sysfs

2020-07-01 Thread Daeho Jeong
> On 2020/7/1 15:04, Daeho Jeong wrote: > > Actually, I want to keep the mount number remaining to the same > > number, even if it's re-mounted. > > Then once there is f2fs umounter, the order will be incorrect... Actually, we prepared this patch for a strictly control

[PATCH v3] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-16 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 --- fs/f2fs/f2fs.h | 15 + fs/f2fs/file.c | 179 + 2 files changed, 194

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

2020-06-08 Thread Daeho Jeong
te: > > 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

[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

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

2020-06-09 Thread Daeho Jeong
; !f2fs_hw_support_discard(sbi)) > > + return -EOPNOTSUPP; > > + > > + ret = mnt_want_write_file(filp); > > + if (ret) > > + return ret; > > + > > + inode_lock(inode); > > + > > + file_size = i_size_read(inod

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

2020-06-09 Thread Daeho Jeong
; access > to the mount is not necessary. I think you should use file_start_write() and > file_end_write(), like vfs_write() does. Yes, agreed. 2020년 6월 10일 (수) 오후 12:15, Eric Biggers 님이 작성: > > On Wed, Jun 10, 2020 at 11:05:46AM +0900, Daeho Jeong wrote: > > > > Added a new ioctl

[PATCH] f2fs: remove race condition in releasing cblocks

2020-05-07 Thread Daeho Jeong
From: Daeho Jeong Now, if writing pages and releasing compress blocks occur simultaneously, and releasing cblocks is executed more than one time to a file, then total block count of filesystem and block count of the file could be incorrect and damaged. We have to execute releasing compress

Re: [f2fs-dev] [PATCH] f2fs: compress: fix zstd data corruption

2020-05-07 Thread Daeho Jeong
Great, thanks for checking~! :) 2020년 5월 8일 (금) 오후 3:42, Chao Yu 님이 작성: > > On 2020/5/8 11:30, Daeho Jeong wrote: > > I am a little bit confused. > > > > In compress_log=2 (4 pages), > > > > Every compression algorithm will set the cc-&

Re: [f2fs-dev] [PATCH] f2fs: remove race condition in releasing cblocks

2020-05-07 Thread Daeho Jeong
Daeho Jeong wrote: > > From: Daeho Jeong > > > > Now, if writing pages and releasing compress blocks occur > > simultaneously, and releasing cblocks is executed more than one time > > to a file, then total block count of filesystem and block count of the > > file

Re: [f2fs-dev] [PATCH] f2fs: remove race condition in releasing cblocks

2020-05-08 Thread Daeho Jeong
Oops, I will re-check it. Thanks, 2020년 5월 8일 (금) 오후 4:09, Chao Yu 님이 작성: > > On 2020/5/8 14:58, Daeho Jeong wrote: > > I moved checking i_compr_blocks phrase after calling inode_lock() > > already, because we should check this after writing pages. > > >

Re: [f2fs-dev] [PATCH] f2fs: fix double count on issued discard commands

2017-09-13 Thread Daeho Jeong
> Actually, we didn't change priority of discard command, so that it is still > synchronous IO for I/O scheduler, hence I/O interference will still exist if > we > try to issue discard without IO aware ability. > Of course we can change the priority of discard command to lower, but > potential

<    1   2   3   >