cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster dlm-kernel/src/locking.c gfs-kernel/sr ...
Date: 1 Feb 2007 23:03:01 -0000	[thread overview]
Message-ID: <20070201230301.18274.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	STABLE
Changes by:	rpeterso at sourceware.org	2007-02-01 23:03:00

Modified files:
	dlm-kernel/src : locking.c 
	gfs-kernel/src/dlm: lock.c 

Log message:
	Don't panic if we try to unlock a plock that's already being unlocked.
	From jwhiter at redhat.com
	bz 220219

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm-kernel/src/locking.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.50.2.8.6.1&r2=1.50.2.8.6.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/dlm/lock.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.15.2.6.6.1&r2=1.15.2.6.6.2

--- cluster/dlm-kernel/src/Attic/locking.c	2006/07/07 15:24:47	1.50.2.8.6.1
+++ cluster/dlm-kernel/src/Attic/locking.c	2007/02/01 23:02:59	1.50.2.8.6.2
@@ -850,7 +850,10 @@
 	if (lkb->lkb_lockqueue_state) {
 		log_error(ls, "(%d) dlm_unlock: %x busy %d",
 			  lkb->lkb_ownpid, lkid, lkb->lkb_lockqueue_state);
-		ret = -EBUSY;
+		if (lkb->lkb_lockqueue_state == GDLM_LQSTATE_WAIT_UNLOCK)
+			ret = -EINPROGRESS;
+		else
+			ret = -EBUSY;
 		goto out;
 	}
 
--- cluster/gfs-kernel/src/dlm/Attic/lock.c	2005/06/29 06:57:08	1.15.2.6.6.1
+++ cluster/gfs-kernel/src/dlm/Attic/lock.c	2007/02/01 23:03:00	1.15.2.6.6.2
@@ -336,7 +336,10 @@
 void do_dlm_unlock(dlm_lock_t *lp)
 {
 	unsigned int lkf = 0;
-	int error;
+	int error, plock = 0;
+
+	if (lp->lockname.ln_type == LM_TYPE_PLOCK)
+		plock = 1;
 
 	set_bit(LFL_DLM_UNLOCK, &lp->flags);
 	set_bit(LFL_WAIT_COMPLETE, &lp->flags);
@@ -351,7 +354,7 @@
 
 	error = dlm_unlock(lp->dlm->gdlm_lsp, lp->lksb.sb_lkid, lkf, NULL, lp);
 
-	DLM_ASSERT(!error,
+	DLM_ASSERT(!error || (plock && error == -EINPROGRESS),
 		   printk("%s: error=%d num=%x,%"PRIx64" lkf=%x flags=%lx\n",
 			  lp->dlm->fsname, error, lp->lockname.ln_type,
 			  lp->lockname.ln_number, lp->lkf, lp->flags););



             reply	other threads:[~2007-02-01 23:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-01 23:03 rpeterso [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-01-03 16:10 [Cluster-devel] cluster dlm-kernel/src/locking.c gfs-kernel/sr teigland

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=20070201230301.18274.qmail@sourceware.org \
    --to=rpeterso@sourceware.org \
    /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).