From: Li Dong <lidong@vivo.com>
To: Bob Peterson <rpeterso@redhat.com>,
Andreas Gruenbacher <agruenba@redhat.com>,
cluster-devel@redhat.com (open list:GFS2 FILE SYSTEM),
linux-kernel@vger.kernel.org (open list)
Cc: opensource.kernel@vivo.com, lidong@vivo.com
Subject: [PATCH] fs: Fix bug in gfs2_freeze_func that can cause deadlock
Date: Tue, 20 Jun 2023 11:38:39 +0800 [thread overview]
Message-ID: <20230620033859.997-1-lidong@vivo.com> (raw)
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
next reply other threads:[~2023-06-20 3:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 3:38 Li Dong [this message]
2023-07-03 20:31 ` Andreas Gruenbacher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230620033859.997-1-lidong@vivo.com \
--to=lidong@vivo.com \
--cc=agruenba@redhat.com \
--cc=cluster-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=opensource.kernel@vivo.com \
--cc=rpeterso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®