All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH dlm/next] fs: dlm: improve plock logging if interrupted
@ 2022-01-12 22:10 Alexander Aring
  0 siblings, 0 replies; only message in thread
From: Alexander Aring @ 2022-01-12 22:10 UTC (permalink / raw)
  To: cluster-devel.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 interruption.

Before this patch there might be a "dev_write no op ..." info message
and I assume that the plock was removed before because 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.

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 c38b2b8ffd1d..6ff61ccccb0b 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -144,11 +144,12 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
 	if (xop->callback == NULL) {
 		rv = wait_event_interruptible(recv_wq, (op->done != 0));
 		if (rv == -ERESTARTSYS) {
-			log_debug(ls, "dlm_posix_lock: wait killed %llx",
-				  (unsigned long long)number);
 			spin_lock(&ops_lock);
 			list_del(&op->list);
 			spin_unlock(&ops_lock);
+			log_print("%s: wait interrupted %x %llx and removed",
+				  __func__, ls->ls_global_id,
+				  (unsigned long long)number);
 			kfree(xop);
 			do_unlock_close(ls, number, file, fl);
 			goto out;
@@ -455,8 +456,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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-12 22:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 22:10 [Cluster-devel] [PATCH dlm/next] fs: dlm: improve plock logging if interrupted Alexander Aring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.