Skip to content

fs: preserve superblock inode walk positions across lock drops - #1277

Open
blktests-ci-kpd[bot] wants to merge 7 commits into
linus-master_basefrom
series/1161167=>linus-master
Open

fs: preserve superblock inode walk positions across lock drops#1277
blktests-ci-kpd[bot] wants to merge 7 commits into
linus-master_basefrom
series/1161167=>linus-master

Conversation

@blktests-ci-kpd

Copy link
Copy Markdown

Pull request for series with
subject: fs: preserve superblock inode walk positions across lock drops
version: 1
url: https://patchwork.kernel.org/series/1161167/

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 893e117
series: https://patchwork.kernel.org/series/1161167/
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 50d05c7
series: https://patchwork.kernel.org/series/1161167/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1161167=>linus-master branch from 76208c9 to 05e2840 Compare September 10, 2026 15:42
Julian Sun added 3 commits September 10, 2026 17:17
Remove trailing whitespace before introducing the inode iterator API.
This avoids unrelated whitespace changes from automatic editor cleanup
in the following patches. This also fixes formatting issues in fs.h
reported by scripts/checkpatch.pl.

Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Add sb_for_each_inodes() to share s_inodes traversal and preserve its
position while s_inode_list_lock is dropped.

Track active iterators on sb->s_inodes_iters and advance their saved
positions before unlinking an inode. Callbacks manage inode references
and per-inode work, allowing both normal walks and eviction to use the
same interface.

Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Convert sync_bdevs() to sb_for_each_inodes() and move device writeback
into a callback. The iterator preserves the walk position, allowing the
callback to iput() its inode before reacquiring the list lock and removing
the old_inode reference carried across iterations.

Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 50d05c7
series: https://patchwork.kernel.org/series/1161167/
version: 1

Julian Sun added 4 commits September 10, 2026 17:17
Use sb_for_each_inodes() in evict_inodes() to avoid rescanning referenced
inodes after each reschedule. Collect eligible inodes during the walk and
dispose of them after it completes.

Convert drop_pagecache_sb() as well, replacing its deferred toput_inode
reference with the iterator's position tracking.

Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Convert gfs2_evict_inodes() to sb_for_each_inodes(). Take and drop the
inode reference within the callback, with iput() outside the list lock,
to retain cooperative eviction. The iterator preserves the walk position
and removes the need for toput_inode.

Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Convert add_dquot_ref() to sb_for_each_inodes(), passing the quota type
to the callback and propagating initialization errors. This removes the
old_inode reference used to preserve the walk position.

Leave remove_dquot_ref() unchanged to avoid adding per-inode locking to a
walk that never drops s_inode_list_lock.

Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Convert hook_sb_delete() to sb_for_each_inodes() and release each
callback's inode reference outside s_inode_list_lock. This removes the
prev_inode reference used to preserve the walk position while retaining
the synchronization with release_inode() and the final wait for pending
inode releases.

Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1161167=>linus-master branch from 05e2840 to 2314183 Compare September 10, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants