All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xue jiufei <xuejiufei@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: fix BUG_ON(res->migration_pending) in dlm_mark_lockres_migrating
Date: Fri, 21 Dec 2012 18:29:45 +0800	[thread overview]
Message-ID: <50D43A19.3070703@huawei.com> (raw)

  When dlm_lockres_release_ast() returns without clearing
res->migration_pending, dlm_mark_lockres_migrating() exits abnormally
with res->migration_pending setting to 1. When reentering
dlm_mark_lockres_migrating(), it will trigger the BUG_ON with
res->migration_pending. Clearing migration_pending when target is
down can resolve this issue.

Signed-off-by: xuejiufei <xuejiufei@huawei.com>
---
 fs/ocfs2/dlm/dlmmaster.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 005261c..c491f97 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -2751,6 +2751,9 @@ again:
 	if (!test_bit(target, dlm->domain_map)) {
 		mlog(ML_ERROR, "aha. migration target %u just went down\n",
 		     target);
+		spin_lock(&res->spinlock);
+		res->migration_pending = 0;
+		spin_unlock(&res->spinlock);
 		ret = -EHOSTDOWN;
 	}
 	spin_unlock(&dlm->spinlock);
-- 
1.7.8.6

                 reply	other threads:[~2012-12-21 10:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=50D43A19.3070703@huawei.com \
    --to=xuejiufei@huawei.com \
    --cc=ocfs2-devel@oss.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 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.