From: Andreas Gruenbacher <agruenba@redhat.com>
To: gfs2@lists.linux.dev
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Subject: [PATCH 11/15] gfs2: Fix "ignore unlock failures after withdraw"
Date: Tue, 9 Apr 2024 18:45:01 +0200 [thread overview]
Message-ID: <20240409164508.79570-12-agruenba@redhat.com> (raw)
In-Reply-To: <20240409164508.79570-1-agruenba@redhat.com>
Commit 3e11e53041502 tries to suppress dlm_lock() lock conversion errors
that occur when the lockspace has already been released.
It does that by setting and checking the SDF_SKIP_DLM_UNLOCK flag. This
conflicts with the intended meaning of the SDF_SKIP_DLM_UNLOCK flag, so
check whether the lockspace is still allocated instead.
(Given the current DLM API, checking for this kind of error after the
fact seems easier that than to make sure that the lockspace is still
allocated before calling dlm_lock(). Changing the DLM API so that users
maintain the lockspace references themselves would be an option.)
Fixes: 3e11e53041502 ("GFS2: ignore unlock failures after withdraw")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
fs/gfs2/glock.c | 4 +++-
fs/gfs2/util.c | 1 -
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index fa047331ea3c..ec1f8eb28950 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -810,11 +810,13 @@ __acquires(&gl->gl_lockref.lock)
}
if (sdp->sd_lockstruct.ls_ops->lm_lock) {
+ struct lm_lockstruct *ls = &sdp->sd_lockstruct;
+
/* lock_dlm */
ret = sdp->sd_lockstruct.ls_ops->lm_lock(gl, target, lck_flags);
if (ret == -EINVAL && gl->gl_target == LM_ST_UNLOCKED &&
target == LM_ST_UNLOCKED &&
- test_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags)) {
+ test_bit(DFL_UNMOUNT, &ls->ls_recover_flags)) {
finish_xmote(gl, target);
gfs2_glock_queue_work(gl, 0);
} else if (ret) {
diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c
index 0535a0206512..09238604d741 100644
--- a/fs/gfs2/util.c
+++ b/fs/gfs2/util.c
@@ -350,7 +350,6 @@ int gfs2_withdraw(struct gfs2_sbd *sdp)
fs_err(sdp, "telling LM to unmount\n");
lm->lm_unmount(sdp);
}
- set_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags);
fs_err(sdp, "File system withdrawn\n");
dump_stack();
clear_bit(SDF_WITHDRAW_IN_PROG, &sdp->sd_flags);
--
2.44.0
next prev parent reply other threads:[~2024-04-09 16:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 16:44 [PATCH 00/15] gfs2 cleanups and fixes Andreas Gruenbacher
2024-04-09 16:44 ` [PATCH 01/15] gfs2: Get rid of newlines in log messages Andreas Gruenbacher
2024-04-09 16:44 ` [PATCH 02/15] gfs2: Remove unnecessary gfs2_meta_check_ii argument Andreas Gruenbacher
2024-04-09 16:44 ` [PATCH 03/15] gfs2: Follow-up to flag rename in sysfs status file Andreas Gruenbacher
2024-04-09 16:44 ` [PATCH 04/15] gfs2: Use [NO_]CREATE consistently for gfs2_glock_get Andreas Gruenbacher
2024-04-09 16:44 ` [PATCH 05/15] gfs2: Don't forget to complete delayed withdraw Andreas Gruenbacher
2024-04-09 16:44 ` [PATCH 06/15] gfs2: Fix NULL pointer dereference in gfs2_log_flush Andreas Gruenbacher
2024-04-09 16:44 ` [PATCH 07/15] gfs2: Get rid of gfs2_glock_queue_put in signal_our_withdraw Andreas Gruenbacher
2024-04-09 16:44 ` [PATCH 08/15] gfs2: Replace gfs2_glock_queue_put with gfs2_glock_put_async Andreas Gruenbacher
2024-04-09 16:44 ` [PATCH 09/15] gfs2: Don't set GLF_LOCK in gfs2_dispose_glock_lru Andreas Gruenbacher
2024-04-09 16:45 ` [PATCH 10/15] gfs2: Get rid of unnecessary test_and_set_bit Andreas Gruenbacher
2024-04-09 16:45 ` Andreas Gruenbacher [this message]
2024-04-09 16:45 ` [PATCH 12/15] Revert "gfs2: fix glock shrinker ref issues" Andreas Gruenbacher
2024-04-09 16:45 ` [PATCH 13/15] gfs2: Fix "Make glock lru list scanning safer" Andreas Gruenbacher
2024-04-16 16:55 ` Andrew Price
2024-04-17 7:55 ` Andreas Gruenbacher
2024-04-09 16:45 ` [PATCH 14/15] gfs2: Get rid of demote_ok checks Andreas Gruenbacher
2024-04-12 6:00 ` Andreas Gruenbacher
2024-04-09 16:45 ` [PATCH 15/15] gfs2: Fix lru_count accounting 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=20240409164508.79570-12-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).