[Ocfs2-commits] smushran commits r2887 - branches/ocfs2-1.2/fs/ocfs2/dlm
svn-commits@oss.oracle.com
svn-commits at oss.oracle.com
Wed Apr 19 21:16:26 CDT 2006
Author: smushran
Signed-off-by: mfasheh
Signed-off-by: khackel
Date: 2006-04-19 21:16:25 -0500 (Wed, 19 Apr 2006)
New Revision: 2887
Modified:
branches/ocfs2-1.2/fs/ocfs2/dlm/dlmlock.c
branches/ocfs2-1.2/fs/ocfs2/dlm/dlmthread.c
Log:
now we never change the owner of a lock resource until unmount or node death
Signed-off-by: mfasheh
Signed-off-by: khackel
Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmlock.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmlock.c 2006-04-20 02:02:55 UTC (rev 2886)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmlock.c 2006-04-20 02:16:25 UTC (rev 2887)
@@ -226,14 +226,18 @@
res->state &= ~DLM_LOCK_RES_IN_PROGRESS;
lock->lock_pending = 0;
if (status != DLM_NORMAL) {
- if (status != DLM_NOTQUEUED)
+ if (status != DLM_NOTQUEUED) {
+ /*
+ * DO NOT call calc_usage, as this would unhash
+ * the remote lockres before we ever get to use
+ * it. treat as if we never made any change to
+ * the lockres.
+ */
+ lockres_changed = 0;
dlm_error(status);
+ }
dlm_revert_pending_lock(res, lock);
dlm_lock_put(lock);
- /* do NOT call calc_usage, as this would unhash the remote
- * lockres before we ever get to use it. treat as if we
- * never made any change to the lockres. */
- lockres_changed = 0;
} else if (dlm_is_recovery_lock(res->lockname.name,
res->lockname.len)) {
/* special case for the $RECOVERY lock.
Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmthread.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmthread.c 2006-04-20 02:02:55 UTC (rev 2886)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmthread.c 2006-04-20 02:16:25 UTC (rev 2887)
@@ -107,6 +107,20 @@
assert_spin_locked(&res->spinlock);
if (__dlm_lockres_unused(res)){
+ /* For now, just keep any resource we master */
+ if (res->owner == dlm->node_num)
+ {
+ if (!list_empty(&res->purge)) {
+ mlog(0, "we master %s:%.*s, but it is on "
+ "the purge list. Removing\n",
+ dlm->name, res->lockname.len,
+ res->lockname.name);
+ list_del_init(&res->purge);
+ dlm->purge_count--;
+ }
+ return;
+ }
+
if (list_empty(&res->purge)) {
mlog(0, "putting lockres %.*s from purge list\n",
res->lockname.len, res->lockname.name);
More information about the Ocfs2-commits
mailing list