From: Alexander Aring <aahringo@redhat.com>
To: teigland@redhat.com
Cc: gfs2@lists.linux.dev, aahringo@redhat.com
Subject: [PATCH dlm/next 5/5] dlm: more debug info on invalid lock requests
Date: Wed, 13 Nov 2024 11:46:43 -0500 [thread overview]
Message-ID: <20241113164643.464055-5-aahringo@redhat.com> (raw)
In-Reply-To: <20241113164643.464055-1-aahringo@redhat.com>
Recently there was an issue coming up about an invalid lkb state when a
convert was triggered. After investigation an recovery issue was the
root of the problem. However we only saw it because QUECVT flag was
being set that was leading DLM to return with -EINVAL on such invalid
state. To cover also such case without QUECVT is set we introduce more
conditions that are required to be checked before initial a DLM lock
conversion.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/lock.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 1e809f591d1a..7217cc566175 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -2830,6 +2830,11 @@ static int validate_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb,
if (test_bit(DLM_IFL_MSTCPY_BIT, &lkb->lkb_iflags))
goto out;
+ /* sanity check to do a conversion on a invalid lkb state */
+ if (lkb->lkb_grmode == DLM_LOCK_IV ||
+ lkb->lkb_status != DLM_LKSTS_GRANTED)
+ goto out;
+
if (args->flags & DLM_LKF_QUECVT &&
!__quecvt_compat_matrix[lkb->lkb_grmode+1][args->mode+1])
goto out;
@@ -2852,14 +2857,16 @@ static int validate_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb,
case -EINVAL:
/* annoy the user because dlm usage is wrong */
WARN_ON(1);
- log_error(ls, "%s %d %x %x %x %d %d", __func__,
+ log_error(ls, "%s %d %x %x %x %d %d %d %d", __func__,
rv, lkb->lkb_id, dlm_iflags_val(lkb), args->flags,
- lkb->lkb_status, lkb->lkb_wait_type);
+ lkb->lkb_status, lkb->lkb_wait_type,
+ lkb->lkb_rqmode, lkb->lkb_grmode);
break;
default:
- log_debug(ls, "%s %d %x %x %x %d %d", __func__,
+ log_debug(ls, "%s %d %x %x %x %d %d %d %d", __func__,
rv, lkb->lkb_id, dlm_iflags_val(lkb), args->flags,
- lkb->lkb_status, lkb->lkb_wait_type);
+ lkb->lkb_status, lkb->lkb_wait_type,
+ lkb->lkb_rqmode, lkb->lkb_grmode);
break;
}
--
2.43.0
prev parent reply other threads:[~2024-11-13 16:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 16:46 [PATCH dlm/next 1/5] dlm: new max length for debugfs entry name Alexander Aring
2024-11-13 16:46 ` [PATCH dlm/next 2/5] dlm: introduce lockspace control debugfs entry Alexander Aring
2024-11-13 16:46 ` [PATCH dlm/next 3/5] dlm: extend debugfs to manipulate more DLM states Alexander Aring
2024-11-13 16:46 ` [PATCH dlm/next 4/5] dlm: fix middle conversion cases in DLM recovery Alexander Aring
2024-11-13 16:46 ` Alexander Aring [this message]
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=20241113164643.464055-5-aahringo@redhat.com \
--to=aahringo@redhat.com \
--cc=gfs2@lists.linux.dev \
--cc=teigland@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