From: Andreas Gruenbacher <agruenba@redhat.com>
To: gfs2@lists.linux.dev
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Subject: [PATCH] gfs2: Fix do_xmote locking error
Date: Thu, 11 Apr 2024 15:52:43 +0200 [thread overview]
Message-ID: <20240411135243.260020-1-agruenba@redhat.com> (raw)
Commit 86934198eefa added a 'goto' statement from the beginning of
do_xmote() to further below where the glock spinlock must no longer be
held. I don't fully understand what's going on here, and apparently
this case isn't covered by our testing. In any case though, we must
drop the glock spinlock before this 'goto' or else we won't be able to
retake the lock at the end of do_xmote().
Fixes: 86934198eefa ("gfs2: Clear flags when withdraw prevents xmote")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
fs/gfs2/glock.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index ce62937d85b5..2c9fdc3f7d76 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -705,8 +705,10 @@ __acquires(&gl->gl_lockref.lock)
int ret;
if (target != LM_ST_UNLOCKED && glock_blocked_by_withdraw(gl) &&
- gh && !(gh->gh_flags & LM_FLAG_NOEXP))
+ gh && !(gh->gh_flags & LM_FLAG_NOEXP)) {
+ spin_unlock(&gl->gl_lockref.lock);
goto skip_inval;
+ }
lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP);
GLOCK_BUG_ON(gl, gl->gl_state == target);
--
2.44.0
next reply other threads:[~2024-04-11 13:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-11 13:52 Andreas Gruenbacher [this message]
2024-04-16 10:10 ` [PATCH 0/3] gfs2: do_xmote fixes Andreas Gruenbacher
2024-04-16 10:10 ` [PATCH 1/3] gfs2: finish_xmote cleanup Andreas Gruenbacher
2024-04-16 10:10 ` [PATCH 2/3] gfs2: do_xmote fixes Andreas Gruenbacher
2024-04-16 10:10 ` [PATCH 3/3] gfs2: Remove and replace gfs2_glock_queue_work 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=20240411135243.260020-1-agruenba@redhat.com \
--to=agruenba@redhat.com \
--cc=gfs2@lists.linux.dev \
/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