From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCHv2 dlm/next 4/6] fs: dlm: improve plock logging if interrupted
Date: Thu, 17 Feb 2022 14:39:15 -0500 [thread overview]
Message-ID: <20220217193917.3292717-5-aahringo@redhat.com> (raw)
In-Reply-To: <20220217193917.3292717-1-aahringo@redhat.com>
This patch changes the log level if a plock is removed when interrupted
from debug to info. Additional it signals now that the plock entity was
removed to let the user know what's happening.
If on a dev_write() a pending plock cannot be find it will signal that
it might have been removed because wait interruption.
Before this patch there might be a "dev_write no op ..." info message
and the users can only guess that the plock was removed before because
the wait interruption. To be sure that is the case we log both messages
on the same log level.
Let both message be logged on info layer because it should not happened
a lot and if it happens it should be clear why the op was not found.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/plock.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
index 757d9013788a..ce1af7986e16 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -161,11 +161,12 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
rv = wait_event_interruptible(recv_wq, (op->done != 0));
if (rv == -ERESTARTSYS) {
- log_debug(ls, "%s: wait killed %llx", __func__,
- (unsigned long long)number);
spin_lock(&ops_lock);
list_del(&op->list);
spin_unlock(&ops_lock);
+ log_print("%s: wait interrupted %x %llx, op removed",
+ __func__, ls->ls_global_id,
+ (unsigned long long)number);
dlm_release_plock_op(op);
do_unlock_close(ls, number, file, fl);
goto out;
@@ -443,8 +444,8 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
else
wake_up(&recv_wq);
} else
- log_print("dev_write no op %x %llx", info.fsid,
- (unsigned long long)info.number);
+ log_print("%s: no op %x %llx - may got interrupted?", __func__,
+ info.fsid, (unsigned long long)info.number);
return count;
}
--
2.31.1
next prev parent reply other threads:[~2022-02-17 19:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 19:39 [Cluster-devel] [PATCHv2 dlm/next 0/6] fs: dlm: cleanup plock code Alexander Aring
2022-02-17 19:39 ` [Cluster-devel] [PATCHv2 dlm/next 1/6] fs: dlm: replace sanity checks with WARN_ON Alexander Aring
2022-02-17 19:39 ` [Cluster-devel] [PATCHv2 dlm/next 2/6] fs: dlm: cleanup plock_op vs plock_xop Alexander Aring
2022-02-17 19:39 ` [Cluster-devel] [PATCHv2 dlm/next 3/6] fs: dlm: rearrange async condition return Alexander Aring
2022-02-17 19:39 ` Alexander Aring [this message]
2022-02-17 19:39 ` [Cluster-devel] [PATCHv2 dlm/next 5/6] fs: dlm: remove unnecessary INIT_LIST_HEAD() Alexander Aring
2022-02-17 19:39 ` [Cluster-devel] [PATCHv2 dlm/next 6/6] fs: dlm: move global to static inits Alexander Aring
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=20220217193917.3292717-5-aahringo@redhat.com \
--to=aahringo@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;
as well as URLs for NNTP newsgroup(s).