[Ocfs2-commits] smushran commits r2992 -
branches/ocfs2-1.2/fs/ocfs2/dlm
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Mar 22 14:11:21 PDT 2007
Author: smushran
Date: 2007-03-22 14:11:20 -0700 (Thu, 22 Mar 2007)
New Revision: 2992
Modified:
branches/ocfs2-1.2/fs/ocfs2/dlm/dlmdomain.c
branches/ocfs2-1.2/fs/ocfs2/dlm/dlmthread.c
Log:
ocfs2_dlm: Fixes lockres ref counting bug
During umount, the umount thread migrates the lockres' and the dlm_thread
frees the empty lockres'. Due to a race, the reference counting on the
lockres goes awry leading to extra puts.
Signed-off-by: mfasheh
Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmdomain.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmdomain.c 2007-03-16 16:40:23 UTC (rev 2991)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmdomain.c 2007-03-22 21:11:20 UTC (rev 2992)
@@ -111,8 +111,10 @@
void __dlm_unhash_lockres(struct dlm_lock_resource *lockres)
{
- hlist_del_init(&lockres->hash_node);
- dlm_lockres_put(lockres);
+ if (!hlist_unhashed(&lockres->hash_node)) {
+ hlist_del_init(&lockres->hash_node);
+ dlm_lockres_put(lockres);
+ }
}
void __dlm_insert_lockres(struct dlm_ctxt *dlm,
Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmthread.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmthread.c 2007-03-16 16:40:23 UTC (rev 2991)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmthread.c 2007-03-22 21:11:20 UTC (rev 2992)
@@ -257,20 +257,14 @@
break;
}
- mlog(0, "removing lockres %.*s:%p from purgelist\n",
- lockres->lockname.len, lockres->lockname.name, lockres);
- list_del_init(&lockres->purge);
- dlm_lockres_put(lockres);
- dlm->purge_count--;
+ dlm_lockres_get(lockres);
/* This may drop and reacquire the dlm spinlock if it
* has to do migration. */
- mlog(0, "calling dlm_purge_lockres!\n");
- dlm_lockres_get(lockres);
if (dlm_purge_lockres(dlm, lockres))
BUG();
+
dlm_lockres_put(lockres);
- mlog(0, "DONE calling dlm_purge_lockres!\n");
/* Avoid adding any scheduling latencies */
cond_resched_lock(&dlm->spinlock);
More information about the Ocfs2-commits
mailing list