diff options
| author | Daeho Jeong <daehojeong@google.com> | 2026-09-09 12:06:36 -0700 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2026-09-14 15:21:48 +0000 |
| commit | e398da0b9131583e0f52bca733eaefc3b3aeae95 (patch) | |
| tree | 1faa7bd6b63b6ec9bb55da38428813db23e324f5 /tools/lib/python | |
| parent | 66eec36c2421383e5b32e9c1740f656474c80df8 (diff) | |
f2fs: fix livelock in syncing dirty inodes
During checkpoint, f2fs_sync_dirty_inodes() and f2fs_sync_inode_meta()
iterate over dirty inodes in their respective lists. If igrab() fails on
an inode (e.g. because it is in the freeing state), the loop continues
without moving the current inode to the tail of the list. As a result,
subsequent iterations pick the same inode repeatedly, preventing other
ready dirty inodes in the list from making forward progress and leading
to a livelock.
Fix this by moving the current inode to the tail of the list
(list_move_tail(&fi->{dirty_list,gdirty_list}, head)) before attempting
igrab() in both f2fs_sync_dirty_inodes() and f2fs_sync_inode_meta().
Additionally, if igrab() fails, yield the CPU with cond_resched() to
allow the evicting thread to finish eviction. Remove the redundant
f2fs_submit_merged_write() call, since .writepages already submits cached
bios via f2fs_submit_merged_write_cond().
v2:
- Also apply list_move_tail() to f2fs_sync_dirty_inodes().
- Remove redundant f2fs_submit_merged_write() calls from both functions,
keeping only cond_resched().
- Update commit title and description.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
