[Ocfs2-commits] smushran commits r3062 -
branches/ocfs2-1.2/fs/ocfs2/dlm
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Sep 28 10:43:54 PDT 2007
Author: smushran
Date: 2007-09-28 10:43:53 -0700 (Fri, 28 Sep 2007)
New Revision: 3062
Modified:
branches/ocfs2-1.2/fs/ocfs2/dlm/dlmcommon.h
branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c
branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c
Log:
ocfs2_dlm: Fix double increment of migrated lockres' owner count
The lockres owner count is getting doubled for migrated lockres'. Patch
fixes problem described in bugzilla#875.
Signed-off-by: mfasheh
Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmcommon.h
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmcommon.h 2007-09-05 23:05:49 UTC (rev 3061)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmcommon.h 2007-09-28 17:43:53 UTC (rev 3062)
@@ -770,6 +770,9 @@
unsigned int len);
int dlm_is_host_down(int errno);
+void dlm_reset_lockres_owner(struct dlm_ctxt *dlm,
+ struct dlm_lock_resource *res,
+ u8 owner);
void dlm_change_lockres_owner(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res,
u8 owner);
Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c 2007-09-05 23:05:49 UTC (rev 3061)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c 2007-09-28 17:43:53 UTC (rev 3062)
@@ -583,8 +583,8 @@
res->owner = owner;
}
-void dlm_change_lockres_owner(struct dlm_ctxt *dlm,
- struct dlm_lock_resource *res, u8 owner)
+void dlm_reset_lockres_owner(struct dlm_ctxt *dlm,
+ struct dlm_lock_resource *res, u8 owner)
{
assert_spin_locked(&res->spinlock);
@@ -597,7 +597,18 @@
atomic_dec(&dlm->unknown_resources);
else
atomic_dec(&dlm->remote_resources);
+}
+void dlm_change_lockres_owner(struct dlm_ctxt *dlm,
+ struct dlm_lock_resource *res, u8 owner)
+{
+ assert_spin_locked(&res->spinlock);
+
+ if (owner == res->owner)
+ return;
+
+ dlm_reset_lockres_owner(dlm, res, owner);
+
dlm_set_lockres_owner(dlm, res, owner);
}
Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c 2007-09-05 23:05:49 UTC (rev 3061)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c 2007-09-28 17:43:53 UTC (rev 3062)
@@ -1443,7 +1443,7 @@
} else {
/* take a reference now to pin the lockres, drop it
* when locks are added in the worker */
- dlm_change_lockres_owner(dlm, res, dlm->node_num);
+ dlm_reset_lockres_owner(dlm, res, dlm->node_num);
}
spin_unlock(&res->spinlock);
More information about the Ocfs2-commits
mailing list