Unverified Commit 6920e338 authored by Christian Brauner's avatar Christian Brauner
Browse files

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: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 484caf5e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);