[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster dlm-kernel/src/locking.c gfs-kernel/sr ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	teigland sourceware org	2007-01-03 16:10:28

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 redhat com
	bz 220219

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm-kernel/src/locking.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.50.2.9&r2=1.50.2.10
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/dlm/lock.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.15.2.7&r2=1.15.2.8

--- cluster/dlm-kernel/src/Attic/locking.c	2006/06/22 14:29:54	1.50.2.9
+++ cluster/dlm-kernel/src/Attic/locking.c	2007/01/03 16:10:27	1.50.2.10
@@ -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 07:28:21	1.15.2.7
+++ cluster/gfs-kernel/src/dlm/Attic/lock.c	2007/01/03 16:10:28	1.15.2.8
@@ -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,8 @@
 
 	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););


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]