[f2fs-dev] [PATCH] f2fs: get rid of f2fs_inode_synced from f2fs_iget

2022-07-20 Thread Yufen Yu via Linux-f2fs-devel
If f2fs_iget cannot search inode from inode cache, it will read the inode from disk. The processing of read from disk and init inode should not dirty the inode, as the commit 530e07042002 ("f2fs: don't mark compressed inode dirty during f2fs_iget()"). Thus, we can remove the unnecessary f2fs_inode

Re: [f2fs-dev] [PATCH v3] dump.f2fs: add -I nid to dump inode by scan full disk

2022-06-14 Thread Yufen Yu via Linux-f2fs-devel
gentry ping... On 2022/6/7 11:40, Yufen Yu wrote: Usage: dump.f2fs -I [inode nid] /dev/sda This feature can be useful for some bugs caused by system crash. We not only need dump current valid node page, but alse the history data in disk, which can give some clues for status change of th

Re: [f2fs-dev] [PATCH v3] dump.f2fs: add -I nid to dump inode by scan full disk

2022-06-06 Thread Yufen Yu via Linux-f2fs-devel
v2: add ASSERT(ret >= 0); v3: skip data segment when scan full disk On 2022/6/7 11:40, Yufen Yu wrote: Usage: dump.f2fs -I [inode nid] /dev/sda This feature can be useful for some bugs caused by system crash. We not only need dump current valid node page, but alse the hi

[f2fs-dev] [PATCH v3] dump.f2fs: add -I nid to dump inode by scan full disk

2022-06-06 Thread Yufen Yu via Linux-f2fs-devel
Usage: dump.f2fs -I [inode nid] /dev/sda This feature can be useful for some bugs caused by system crash. We not only need dump current valid node page, but alse the history data in disk, which can give some clues for status change of the inode. Signed-off-by: Yufen Yu --- fsck/dump.c

[f2fs-dev] [PATCH v2] f2fs: replace F2FS_I(inode) by the local variable

2022-05-25 Thread Yufen Yu via Linux-f2fs-devel
We have define 'fi' at the begin of the functions, just use it, rather than use F2FS_I(inode) again. Signed-off-by: Yufen Yu --- fs/f2fs/f2fs.h | 2 +- fs/f2fs/file.c | 14 +++--- fs/f2fs/inode.c | 12 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/f2

[f2fs-dev] [PATCH 2/2] f2fs: add f2fs_init_write_merge_io function

2022-05-25 Thread Yufen Yu via Linux-f2fs-devel
Almost all other initialization of variables in f2fs_fill_super are extraced to a single function. Also do it for write_io[], which can make code more clean. This patch just refactors the code, theres no functional change. Signed-off-by: Yufen Yu --- fs/f2fs/data.c | 30 +++

[f2fs-dev] [PATCH 1/2] f2fs: replace F2FS_I(inode) by the local variable

2022-05-25 Thread Yufen Yu via Linux-f2fs-devel
We have define 'fi' at the begin of function do_read_inode(), just use it, rather than use F2FS_I(inode) again. Signed-off-by: Yufen Yu --- fs/f2fs/inode.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 83639238a1fe..9bad349be9

Re: [f2fs-dev] [PATCH v2] dump.f2fs: add -I nid to dump inode by scan full disk

2022-04-20 Thread Yufen Yu via Linux-f2fs-devel
On 2022/4/19 10:10, Chao Yu wrote: On 2022/4/18 10:43, Yufen Yu via Linux-f2fs-devel wrote: Usage: dump.f2fs -I [inode nid] /dev/sda This feature can be useful for some bugs caused by system crash. We not only need dump current valid node page, but alse the history data in disk, which

[f2fs-dev] [PATCH v2] dump.f2fs: add -I nid to dump inode by scan full disk

2022-04-17 Thread Yufen Yu via Linux-f2fs-devel
Usage: dump.f2fs -I [inode nid] /dev/sda This feature can be useful for some bugs caused by system crash. We not only need dump current valid node page, but alse the history data in disk, which can give some clues for status change of the inode. Signed-off-by: Yufen Yu --- fsck/dump.c

[f2fs-dev] [PATCH] dump.f2fs: add -I nid to dump inode by scan full disk

2022-04-14 Thread Yufen Yu via Linux-f2fs-devel
Usage: dump.f2fs -I [inode nid] /dev/sda This feature can be useful for some bugs caused by system crash. We not only need dump current valid node page, but alse the history data in disk, which can give some clues for status change of the inode. Signed-off-by: Yufen Yu --- fsck/dump.c |

Re: [f2fs-dev] [PATCH 4/5] f2fs: get rid of stale fault injection code

2022-04-12 Thread Yufen Yu via Linux-f2fs-devel
On 2022/4/12 5:20, Jaegeuk Kim wrote: On 04/11, Chao Yu wrote: On 2022/4/6 11:01, Yufen Yu via Linux-f2fs-devel wrote: Hi, On 2022/4/1 16:28, Chao Yu wrote: On 2022/4/1 15:19, Yufen Yu via Linux-f2fs-devel wrote: Nowly, we can use new fault injection framework. Just delete the stale fault

Re: [f2fs-dev] [PATCH 4/5] f2fs: get rid of stale fault injection code

2022-04-05 Thread Yufen Yu via Linux-f2fs-devel
Hi, On 2022/4/1 16:28, Chao Yu wrote: On 2022/4/1 15:19, Yufen Yu via Linux-f2fs-devel wrote: Nowly, we can use new fault injection framework. Just delete the stale fault injection code. Signed-off-by: Yufen Yu ---   fs/f2fs/checkpoint.c |  2 +-   fs/f2fs/f2fs.h   | 51

[f2fs-dev] [PATCH 3/5] f2fs: replace function time_to_inject by f2fs_should_fail

2022-04-01 Thread Yufen Yu via Linux-f2fs-devel
Replace all time_to_inject by f2fs_should_fail to apply new fault inject. Signed-off-by: Yufen Yu --- fs/f2fs/checkpoint.c | 2 +- fs/f2fs/data.c | 4 ++-- fs/f2fs/dir.c| 2 +- fs/f2fs/f2fs.h | 16 fs/f2fs/file.c | 2 +- fs/f2fs/gc.c | 2 +-

[f2fs-dev] [PATCH 2/5] f2fs: use common fault injection frmework

2022-04-01 Thread Yufen Yu via Linux-f2fs-devel
For now, f2fs use mount options 'fault_injection' and 'fault_type' to enable fault injection. We set inject_type and inject_rate in sysfs to control fault injection. In fact, common fault injection framework have provided a systematic way to support error injection via debugfs, which has more rich

[f2fs-dev] [PATCH 1/5] f2fs: extract f2fs root debugfs to init_f2fs_fs

2022-04-01 Thread Yufen Yu via Linux-f2fs-devel
Then, we don't need to depend on CONFIG_F2FS_STAT_FS to create f2fs root debugfs directory /sys/kernel/debug/f2fs. This patch is prepared for following f2fs fault injection, which will create sub directory 'fault_inject' into f2fs root debugfs. Signed-off-by: Yufen Yu --- fs/f2fs/debug.c | 19 +

[f2fs-dev] [PATCH 4/5] f2fs: get rid of stale fault injection code

2022-04-01 Thread Yufen Yu via Linux-f2fs-devel
Nowly, we can use new fault injection framework. Just delete the stale fault injection code. Signed-off-by: Yufen Yu --- fs/f2fs/checkpoint.c | 2 +- fs/f2fs/f2fs.h | 51 ++ fs/f2fs/super.c | 53 fs/

[f2fs-dev] [PATCH 0/5] f2fs: try to use common fault injection framework

2022-04-01 Thread Yufen Yu via Linux-f2fs-devel
Hi, Kernel fault injection framework have provided a a systematic way to support error injection via debugfs in the /sys/kernel/debug directory. Compared to the current fault injection by mount options and sysfs, fault injection framework can provide more easy used fault injection con

[f2fs-dev] [PATCH 5/5] f2fs: update doc for f2fs fault injection

2022-04-01 Thread Yufen Yu via Linux-f2fs-devel
Just update doc for fault injection. Signed-off-by: Yufen Yu --- Documentation/filesystems/f2fs.rst | 118 ++--- 1 file changed, 90 insertions(+), 28 deletions(-) diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst index 4a2426f0485a..e8