Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH] fs: unlock the superblock during iterate_supers_type
@ 2025-06-11 16:40 Darrick J. Wong
  2025-06-12 10:09 ` Jan Kara
  2025-06-12 12:27 ` Christian Brauner
  0 siblings, 2 replies; 3+ messages in thread
From: Darrick J. Wong @ 2025-06-11 16:40 UTC (permalink / raw)
  To: Christian Brauner; +Cc: linux-fsdevel, jack, linux-kernel

From: Darrick J. Wong <djwong@kernel.org>

This function takes super_lock in shared mode, so it should release the
same lock.

Cc: <stable@vger.kernel.org> # v6.16-rc1
Fixes: af7551cf13cf7f ("super: remove pointless s_root checks")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 fs/super.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/super.c b/fs/super.c
index 21799e213fd747..80418ca8e215bb 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -964,8 +964,10 @@ void iterate_supers_type(struct file_system_type *type,
 		spin_unlock(&sb_lock);
 
 		locked = super_lock_shared(sb);
-		if (locked)
+		if (locked) {
 			f(sb, arg);
+			super_unlock_shared(sb);
+		}
 
 		spin_lock(&sb_lock);
 		if (p)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-12 12:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-11 16:40 [PATCH] fs: unlock the superblock during iterate_supers_type Darrick J. Wong
2025-06-12 10:09 ` Jan Kara
2025-06-12 12:27 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox