ocfs2 fixes
PATCH 1/1 ocfs2 fixes
Hi Linus,
These two fixes are for ocfs2 dlm regressions introduced during the
merge window.
Please pull from 'upstream-linus' branch ofgit://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git upstream-linus
to receive the following updates:
fs/ocfs2/dlm/dlmdomain.c | 8 ++- fs/ocfs2/dlm/dlmmaster.c | 99 ++++++++++++++++++++++++++++++----------------- fs/ocfs2/dlm/dlmthread.c | 10 ---- 3 files changed, 73 insertions(+), 44 deletions(-)
Sunil Mushran:
ocfs2_dlm: Fix lockres ref counting bug
ocfs2_dlm: Check for migrateable lockres in dlm_empty_lockres()
fs/ocfs2/dlm/dlmdomain.c +6 -2
@@ -138,8 +138,10 @@ static void dlm_unregister_domain_handlevoid __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,
@@ -655,6 +657,8 @@ void dlm_unregister_domain(struct dlm_ctdlm_kick_thread (dlm,NULL );while (dlm_migrate_all_locks (dlm)) { +/* Give dlm_thread time to purge the lockres' */ +msleep (500 );mlog (0 ,"%s: more migration to do\n" , dlm->name); }dlm_mark_domain_leaving (dlm);
fs/ocfs2/dlm/dlmmaster.c +65 -34
139 lines not on this page · raw message
fs/ocfs2/dlm/dlmthread.c +2 -8
@@ -256,20 +256,14 @@ static void dlm_run_purge_list(struct dlbreak ; } -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);