mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs: Fix bug in gfs2_freeze_func that can cause deadlock
@ 2023-06-20  3:38 Li Dong
  2023-07-03 20:31 ` Andreas Gruenbacher
  0 siblings, 1 reply; 2+ messages in thread
From: Li Dong @ 2023-06-20  3:38 UTC (permalink / raw)
  To: Bob Peterson, Andreas Gruenbacher, open list:GFS2 FILE SYSTEM, open list
  Cc: opensource.kernel, lidong

Function gfs2_freeze_func causes a deadlock,because sd_freeze_mutex was
not released when return

Signed-off-by: Li Dong <lidong@vivo.com>
---
 fs/gfs2/super.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -741,8 +741,10 @@ void gfs2_freeze_func(struct work_struct *work)
 	set_bit(SDF_FROZEN, &sdp->sd_flags);
 
 	error = gfs2_do_thaw(sdp);
-	if (error)
+	if (error) {
+		mutex_unlock(&sdp->sd_freeze_mutex);
 		goto out;
+	}
 
 	clear_bit(SDF_FROZEN, &sdp->sd_flags);
 
-- 
2.31.1.windows.1


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

end of thread, other threads:[~2023-07-03 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-20  3:38 [PATCH] fs: Fix bug in gfs2_freeze_func that can cause deadlock Li Dong
2023-07-03 20:31 ` Andreas Gruenbacher

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

all inboxes | Powered by JetHome®