mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Fasheh <mfasheh@suse.com>
To: linux-kernel@vger.kernel.org
Cc: ocfs2-devel@oss.oracle.com, Joel Becker <joel.becker@oracle.com>,
	Sunil Mushran <sunil.mushran@oracle.com>,
	Mark Fasheh <mfasheh@suse.com>
Subject: [PATCH 26/35] ocfs2/dlm: Clean up errors in dlm_proxy_ast_handler()
Date: Thu, 25 Dec 2008 10:04:41 -0800	[thread overview]
Message-ID: <1230228290-22803-27-git-send-email-mfasheh@suse.com> (raw)
In-Reply-To: <1230228290-22803-1-git-send-email-mfasheh@suse.com>

From: Sunil Mushran <sunil.mushran@oracle.com>

Patch cleans printed errors in dlm_proxy_ast_handler(). The errors now includes
the node number that sent the (b)ast. Also it reduces the number of endian swaps
of the cookie.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
---
 fs/ocfs2/dlm/dlmast.c |   52 +++++++++++++++++++++++++-----------------------
 1 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/fs/ocfs2/dlm/dlmast.c b/fs/ocfs2/dlm/dlmast.c
index 644bee5..d07ddbe 100644
--- a/fs/ocfs2/dlm/dlmast.c
+++ b/fs/ocfs2/dlm/dlmast.c
@@ -275,6 +275,7 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
 	struct list_head *iter, *head=NULL;
 	u64 cookie;
 	u32 flags;
+	u8 node;
 
 	if (!dlm_grab(dlm)) {
 		dlm_error(DLM_REJECTED);
@@ -286,18 +287,21 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
 
 	name = past->name;
 	locklen = past->namelen;
-	cookie = be64_to_cpu(past->cookie);
+	cookie = past->cookie;
 	flags = be32_to_cpu(past->flags);
+	node = past->node_idx;
 
 	if (locklen > DLM_LOCKID_NAME_MAX) {
 		ret = DLM_IVBUFLEN;
-		mlog(ML_ERROR, "Invalid name length in proxy ast handler!\n");
+		mlog(ML_ERROR, "Invalid name length (%d) in proxy ast "
+		     "handler!\n", locklen);
 		goto leave;
 	}
 
 	if ((flags & (LKM_PUT_LVB|LKM_GET_LVB)) ==
 	     (LKM_PUT_LVB|LKM_GET_LVB)) {
-		mlog(ML_ERROR, "both PUT and GET lvb specified\n");
+		mlog(ML_ERROR, "Both PUT and GET lvb specified, (0x%x)\n",
+		     flags);
 		ret = DLM_BADARGS;
 		goto leave;
 	}
@@ -310,22 +314,21 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
 	if (past->type != DLM_AST &&
 	    past->type != DLM_BAST) {
 		mlog(ML_ERROR, "Unknown ast type! %d, cookie=%u:%llu"
-		     "name=%.*s\n", past->type, 
-		     dlm_get_lock_cookie_node(cookie),
-		     dlm_get_lock_cookie_seq(cookie),
-		     locklen, name);
+		     "name=%.*s, node=%u\n", past->type,
+		     dlm_get_lock_cookie_node(be64_to_cpu(cookie)),
+		     dlm_get_lock_cookie_seq(be64_to_cpu(cookie)),
+		     locklen, name, node);
 		ret = DLM_IVLOCKID;
 		goto leave;
 	}
 
 	res = dlm_lookup_lockres(dlm, name, locklen);
 	if (!res) {
-		mlog(0, "got %sast for unknown lockres! "
-		     "cookie=%u:%llu, name=%.*s, namelen=%u\n",
-		     past->type == DLM_AST ? "" : "b",
-		     dlm_get_lock_cookie_node(cookie),
-		     dlm_get_lock_cookie_seq(cookie),
-		     locklen, name, locklen);
+		mlog(0, "Got %sast for unknown lockres! cookie=%u:%llu, "
+		     "name=%.*s, node=%u\n", (past->type == DLM_AST ? "" : "b"),
+		     dlm_get_lock_cookie_node(be64_to_cpu(cookie)),
+		     dlm_get_lock_cookie_seq(be64_to_cpu(cookie)),
+		     locklen, name, node);
 		ret = DLM_IVLOCKID;
 		goto leave;
 	}
@@ -337,12 +340,12 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
 
 	spin_lock(&res->spinlock);
 	if (res->state & DLM_LOCK_RES_RECOVERING) {
-		mlog(0, "responding with DLM_RECOVERING!\n");
+		mlog(0, "Responding with DLM_RECOVERING!\n");
 		ret = DLM_RECOVERING;
 		goto unlock_out;
 	}
 	if (res->state & DLM_LOCK_RES_MIGRATING) {
-		mlog(0, "responding with DLM_MIGRATING!\n");
+		mlog(0, "Responding with DLM_MIGRATING!\n");
 		ret = DLM_MIGRATING;
 		goto unlock_out;
 	}
@@ -351,7 +354,7 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
 	lock = NULL;
 	list_for_each(iter, head) {
 		lock = list_entry (iter, struct dlm_lock, list);
-		if (be64_to_cpu(lock->ml.cookie) == cookie)
+		if (lock->ml.cookie == cookie)
 			goto do_ast;
 	}
 
@@ -363,15 +366,15 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
 
 	list_for_each(iter, head) {
 		lock = list_entry (iter, struct dlm_lock, list);
-		if (be64_to_cpu(lock->ml.cookie) == cookie)
+		if (lock->ml.cookie == cookie)
 			goto do_ast;
 	}
 
-	mlog(0, "got %sast for unknown lock!  cookie=%u:%llu, "
-	     "name=%.*s, namelen=%u\n", past->type == DLM_AST ? "" : "b", 
-	     dlm_get_lock_cookie_node(cookie),
-	     dlm_get_lock_cookie_seq(cookie),
-	     locklen, name, locklen);
+	mlog(0, "Got %sast for unknown lock! cookie=%u:%llu, name=%.*s, "
+	     "node=%u\n", past->type == DLM_AST ? "" : "b",
+	     dlm_get_lock_cookie_node(be64_to_cpu(cookie)),
+	     dlm_get_lock_cookie_seq(be64_to_cpu(cookie)),
+	     locklen, name, node);
 
 	ret = DLM_NORMAL;
 unlock_out:
@@ -383,8 +386,8 @@ do_ast:
 	if (past->type == DLM_AST) {
 		/* do not alter lock refcount.  switching lists. */
 		list_move_tail(&lock->list, &res->granted);
-		mlog(0, "ast: adding to granted list... type=%d, "
-			  "convert_type=%d\n", lock->ml.type, lock->ml.convert_type);
+		mlog(0, "ast: Adding to granted list... type=%d, "
+		     "convert_type=%d\n", lock->ml.type, lock->ml.convert_type);
 		if (lock->ml.convert_type != LKM_IVMODE) {
 			lock->ml.type = lock->ml.convert_type;
 			lock->ml.convert_type = LKM_IVMODE;
@@ -408,7 +411,6 @@ do_ast:
 		dlm_do_local_bast(dlm, res, lock, past->blocked_type);
 
 leave:
-
 	if (res)
 		dlm_lockres_put(res);
 
-- 
1.5.6


  parent reply	other threads:[~2008-12-25 18:14 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-25 18:04 [git patches] Ocfs2 patches for merge window, batch 3/3 Mark Fasheh
2008-12-25 18:04 ` [PATCH 01/35] jbd2: Add buffer triggers Mark Fasheh
2008-12-31 18:16   ` [Ocfs2-devel] " Mark Fasheh
2008-12-25 18:04 ` [PATCH 02/35] ocfs2: Add the on-disk structures for metadata checksums Mark Fasheh
2008-12-25 18:04 ` [PATCH 03/35] ocfs2: Add the underlying blockcheck code Mark Fasheh
2008-12-25 18:04 ` [PATCH 04/35] ocfs2: Add a validation hook for quota block reads Mark Fasheh
2008-12-25 18:04 ` [PATCH 05/35] ocfs2: block read meta ecc Mark Fasheh
2008-12-25 18:04 ` [PATCH 06/35] ocfs2: Add journal_access functions with jbd2 triggers Mark Fasheh
2008-12-25 18:04 ` [PATCH 07/35] ocfs2: Wrap up the common use cases of ocfs2_new_path() Mark Fasheh
2008-12-25 18:04 ` [PATCH 08/35] ocfs2: Use metadata-specific ocfs2_journal_access_*() functions Mark Fasheh
2008-12-25 18:04 ` [PATCH 09/35] ocfs2: Add ecc and checksums to ocfs2 xattr buckets Mark Fasheh
2008-12-25 18:04 ` [PATCH 10/35] ocfs2: Create ocfs2_xattr_value_buf Mark Fasheh
2008-12-25 18:04 ` [PATCH 11/35] ocfs2: Pull ocfs2_xattr_value_buf up from __ocfs2_remove_xattr_range() Mark Fasheh
2008-12-25 18:04 ` [PATCH 12/35] ocfs2: Pull ocfs2_xattr_value_buf up into ocfs2_xattr_value_truncate() Mark Fasheh
2008-12-25 18:04 ` [PATCH 13/35] ocfs2: Pass ocfs2_xattr_value_buf " Mark Fasheh
2008-12-25 18:04 ` [PATCH 14/35] ocfs2: Pass value buf to ocfs2_xattr_update_entry() Mark Fasheh
2008-12-25 18:04 ` [PATCH 15/35] ocfs2: Use ocfs2_xattr_value_buf in ocfs2_xattr_set_entry() Mark Fasheh
2008-12-25 18:04 ` [PATCH 16/35] ocfs2: Pass value buf to ocfs2_remove_value_outside() Mark Fasheh
2008-12-25 18:04 ` [PATCH 17/35] ocfs2: Use proper journal_access function in xattr.c Mark Fasheh
2008-12-25 18:04 ` [PATCH 18/35] ocfs2: Add directory block trailers Mark Fasheh
2008-12-25 18:04 ` [PATCH 19/35] ocfs2: Checksum and ECC for directory blocks Mark Fasheh
2008-12-25 18:04 ` [PATCH 20/35] ocfs2: Validate superblock with checksum and ecc Mark Fasheh
2008-12-25 18:04 ` [PATCH 21/35] ocfs2: Enable metadata checksums Mark Fasheh
2008-12-25 18:04 ` [PATCH 22/35] ocfs2: Don't hand-code xor in ocfs2_hamming_encode() Mark Fasheh
2008-12-25 18:04 ` [PATCH 23/35] ocfs2: Another hamming code optimization Mark Fasheh
2008-12-25 18:04 ` [PATCH 24/35] ocfs2: One more " Mark Fasheh
2008-12-25 18:04 ` [PATCH 25/35] ocfs2/dlm: Fix a race between migrate request and exit domain Mark Fasheh
2008-12-25 18:04 ` Mark Fasheh [this message]
2008-12-25 18:04 ` [PATCH 27/35] ocfs2/dlm: Hold off sending lockres drop ref message while lockres is migrating Mark Fasheh
2008-12-25 18:04 ` [PATCH 28/35] ocfs2/dlm: Fix race in adding/removing lockres' to/from the tracking list Mark Fasheh
2008-12-25 18:04 ` [PATCH 29/35] ocfs2/dlm: Fix race during lockres mastery Mark Fasheh
2008-12-25 18:04 ` [PATCH 30/35] ocfs2/xattr: Remove extend_trans call and add its credits from the beginning Mark Fasheh
2008-12-25 18:04 ` [PATCH 31/35] ocfs2/xattr: Always updating ctime during xattr set Mark Fasheh
2008-12-25 18:04 ` [PATCH 32/35] ocfs2/xattr: fix credits calculation during index create Mark Fasheh
2008-12-25 18:04 ` [PATCH 33/35] ocfs2: calculate and reserve credits for xattr value in mknod Mark Fasheh
2008-12-25 18:04 ` [PATCH 34/35] ocfs2: alloc xattr bucket in ocfs2_xattr_set_handle Mark Fasheh
2008-12-25 18:04 ` [PATCH 35/35] ocfs2: Add xattr support checking in init_security Mark Fasheh

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=1230228290-22803-27-git-send-email-mfasheh@suse.com \
    --to=mfasheh@suse.com \
    --cc=joel.becker@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=sunil.mushran@oracle.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

all inboxes | Powered by JetHome®