diff options
| author | Christian Brauner <brauner@kernel.org> | 2025-03-29 11:42:16 +0300 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-04-07 10:37:16 +0300 |
| commit | 6920e3388ba4c66b0468d43bb7a373f5fff15d35 (patch) | |
| tree | 8ba629121b7449c73861dc22aebafa30c92109bb | |
| parent | 484caf5e117a9334a08b1d69542e1065be4b30ab (diff) | |
| download | linux-6920e3388ba4c66b0468d43bb7a373f5fff15d35.tar.xz | |
super: skip dying superblocks early
Make all iterators uniform by performing an early check whether the
superblock is dying.
Link: https://lore.kernel.org/r/20250329-work-freeze-v2-3-a47af37ecc3d@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
| -rw-r--r-- | fs/super.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/super.c b/fs/super.c index b1acfc38ba0c..c67ea3cdda41 100644 --- a/fs/super.c +++ b/fs/super.c @@ -925,6 +925,9 @@ void iterate_supers(void (*f)(struct super_block *, void *), void *arg) list_for_each_entry(sb, &super_blocks, s_list) { bool locked; + if (super_flags(sb, SB_DYING)) + continue; + sb->s_count++; spin_unlock(&sb_lock); @@ -962,6 +965,9 @@ void iterate_supers_type(struct file_system_type *type, hlist_for_each_entry(sb, &type->fs_supers, s_instances) { bool locked; + if (super_flags(sb, SB_DYING)) + continue; + sb->s_count++; spin_unlock(&sb_lock); |
