[f2fs-dev] [PATCH v2] f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE

2022-09-19 Thread Daeho Jeong
From: Daeho Jeong introduce a new ioctl to replace the whole content of a file atomically, which means it induces truncate and content update at the same time. We can start it with F2FS_IOC_START_ATOMIC_REPLACE and complete it with F2FS_IOC_COMMIT_ATOMIC_WRITE. Or abort it with

[f2fs-dev] [PATCH] f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE

2022-09-19 Thread Daeho Jeong
From: Daeho Jeong introduce a new ioctl to replace the whole content of a file atomically, which means it induces truncate and content update at the same time. We can start it with F2FS_IOC_START_ATOMIC_REPLACE and complete it with F2FS_IOC_COMMIT_ATOMIC_WRITE. Or abort it with

[f2fs-dev] [PATCH V3] f2fs: fix some error handling case in gc

2022-09-19 Thread zhiguo.niu
During GC, if segment type stored in SSA and SIT is inconsistent, we set SBI_NEED_FSCK first and then stop checkpoint, this will cause the following issues: 1. SBI_NEED_FSCK can not be set to flash truly because of checkpoint has been stopped. 2. Will cause more EIO error if user use f2fs because

Re: [f2fs-dev] [PATCH 2/2] f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE

2022-09-19 Thread kernel test robot
Hi Daeho, Thank you for the patch! Yet something to improve: [auto build test ERROR on jaegeuk-f2fs/dev-test] [also build test ERROR on linus/master v6.0-rc6 next-20220919] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use

Re: [f2fs-dev] [RFC PATCH v2] f2fs: record need_fsck in super_block

2022-09-19 Thread Jaegeuk Kim
On 09/13, Chao Yu wrote: > Once CP_ERROR_FLAG is set, checkpoint is disallowed to be triggered to > persist CP_FSCK_FLAG, fsck won't repair the image due to lack of > CP_FSCK_FLAG. > > This patch proposes to persist newly introduced SB_NEED_FSCK flag into > super block if CP_ERROR_FLAG and

Re: [f2fs-dev] [PATCH 1/1] f2fs: fix to check space of current segment journal

2022-09-19 Thread Jaegeuk Kim
Hi Philippe, Kernel 4.1 is really old one, so is there any chance to upgrade the kernel at least 4.14? You can find all the backports from below. https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable.git On 09/16, Philippe De Muyter wrote: > Tnank you for your patch. > > I have

[f2fs-dev] [PATCH] f2fs-tools: support F2FS_IOC_START_ATOMIC_REPLACE

2022-09-19 Thread Daeho Jeong
From: Daeho Jeong Added options in f2fs_io write command to support F2FS_IOC_START_ATOMIC_REPLACE. Signed-off-by: Daeho Jeong --- tools/f2fs_io/f2fs_io.c | 31 ++- tools/f2fs_io/f2fs_io.h | 1 + 2 files changed, 23 insertions(+), 9 deletions(-) diff --git

[f2fs-dev] [PATCH 2/2] f2fs: introduce F2FS_IOC_START_ATOMIC_REPLACE

2022-09-19 Thread Daeho Jeong
From: Daeho Jeong introduce a new ioctl to replace the whole content of a file atomically, which means it induces truncate and content update at the same time. We can start it with F2FS_IOC_START_ATOMIC_REPLACE and complete it with F2FS_IOC_COMMIT_ATOMIC_WRITE. Or abort it with

[f2fs-dev] [PATCH 1/2] f2fs: correct i_size change for atomic writes

2022-09-19 Thread Daeho Jeong
From: Daeho Jeong We need to make sure i_size doesn't change until atomic write commit is successful and restore it when commit is failed. Signed-off-by: Daeho Jeong --- fs/f2fs/f2fs.h| 1 + fs/f2fs/file.c| 16 +--- fs/f2fs/inode.c | 3 +++ fs/f2fs/segment.c | 4 +++-

Re: [f2fs-dev] [PATCH v2 -next] f2fs: add "c_len" into trace_f2fs_update_extent_tree_range for compressed file

2022-09-19 Thread Chao Yu
On 2022/9/19 19:57, Zhang Qilong wrote: The trace_f2fs_update_extent_tree_range could not record compressed block length in the cluster of compress file and we just add it. Signed-off-by: Zhang Qilong Reviewed-by: Chao Yu Thanks, ___

[f2fs-dev] 答复: [PATCH -next] f2fs: add a trace interface for f2fs_update_extent_tree_range_compressed

2022-09-19 Thread zhangqilong via Linux-f2fs-devel
> On 2022/9/15 21:44, Zhang Qilong wrote: > > For f2fs_update_extent_tree_range_compressed, keeping the trace > and > > function name consistent to distinguish from trace of > > f2fs_update_extent_tree_range. And we add "c_len" into the trace, > > result like: > > > >[003] . 228.568157:

[f2fs-dev] [PATCH v2 -next] f2fs: add "c_len" into trace_f2fs_update_extent_tree_range for compressed file

2022-09-19 Thread Zhang Qilong via Linux-f2fs-devel
The trace_f2fs_update_extent_tree_range could not record compressed block length in the cluster of compress file and we just add it. Signed-off-by: Zhang Qilong --- v2: - modify the title --- fs/f2fs/extent_cache.c | 4 ++-- include/trace/events/f2fs.h | 13 + 2 files changed,

[f2fs-dev] [PATCH -next] f2fs: add "c_len" into f2fs_update_extent_tree_range for compress file

2022-09-19 Thread Zhang Qilong via Linux-f2fs-devel
The trace_f2fs_update_extent_tree_range could not record compressed block length in the cluster of compress file and we just add it. Signed-off-by: Zhang Qilong --- fs/f2fs/extent_cache.c | 4 ++-- include/trace/events/f2fs.h | 13 + 2 files changed, 11 insertions(+), 6

[f2fs-dev] [Bug 216285] KASAN: slab-out-of-bounds in mutex_lock and NULL pointer dereference at fs/f2fs/segment.c: f2fs_update_meta_page() when mount a crafted f2fs image

2022-09-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216285 Chao Yu (c...@kernel.org) changed: What|Removed |Added Status|ASSIGNED|RESOLVED

[f2fs-dev] [PATCH V2] f2fs: fix some error handling case in gc

2022-09-19 Thread zhiguo.niu
During GC, if segment type stored in SSA and SIT is inconsistent, we set SBI_NEED_FSCK first and then stop checkpoint, this will cause the following issues: 1. SBI_NEED_FSCK can not be set to flash truly because of checkpoint has been stopped. 2. Will cause more EIO error if user use f2fs because