All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tariq Saeed <tariq.x.saeed@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/1] ocfs2/dlm: ocfs2 dlm umount skip migrating lockres
Date: Wed, 11 Sep 2013 11:40:30 -0700	[thread overview]
Message-ID: <1378924830-16356-1-git-send-email-tariq.x.saeed@oracle.com> (raw)

umount thread could race with migrate handler thread receiving resource
migration request from other node. When this happens, migrating thread
could set this node as the master along with DLM_LOCK_RES_MIGRATING flag.
umount thread should skip migrating this newly owned lockres until
DLM_LOCK_RES_MIGRATING flag is unset by migrate handler thread. umount
thread will ultimately migrate this lockres during another pass of the
lockres hash list.

Signed-off-by: Tariq Saeed <tariq.x.saeed@oracle.com>
Signed-off-by: Srinivas Eeda <srinivas.eeda@oracle.com> 
---
 fs/ocfs2/dlm/dlmmaster.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 33ecbe0..1643b58 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -2360,6 +2360,10 @@ static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm,
 	if (res->owner != dlm->node_num)
 		return 0;
 
+	if (res->state & DLM_LOCK_RES_MIGRATING) {
+		return 0;
+	}
+
         for (idx = DLM_GRANTED_LIST; idx <= DLM_BLOCKED_LIST; idx++) {
 		queue = dlm_list_idx_to_ptr(res, idx);
 		list_for_each_entry(lock, queue, list) {
-- 
1.7.1

             reply	other threads:[~2013-09-11 18:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11 18:40 Tariq Saeed [this message]
2013-09-12  2:07 ` [Ocfs2-devel] [PATCH 1/1] ocfs2/dlm: ocfs2 dlm umount skip migrating lockres Joseph Qi
2013-09-12  4:00   ` Srinivas Eeda
2013-09-20 20:56     ` Andrew Morton

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=1378924830-16356-1-git-send-email-tariq.x.saeed@oracle.com \
    --to=tariq.x.saeed@oracle.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.