Commit 8b219809 authored by Kurt Hackel's avatar Kurt Hackel Committed by Mark Fasheh
Browse files

ocfs2: purge lockres' sooner

Immediately purge a lockress that the local node is not the master of.
Signed-off-by: default avatarKurt Hackel <>
Signed-off-by: default avatarMark Fasheh <>
parent 343e26a4
......@@ -54,6 +54,8 @@
#include "cluster/masklog.h"
static int dlm_thread(void *data);
static void dlm_purge_lockres_now(struct dlm_ctxt *dlm,
struct dlm_lock_resource *lockres);
static void dlm_flush_asts(struct dlm_ctxt *dlm);
......@@ -111,10 +113,23 @@ void __dlm_lockres_calc_usage(struct dlm_ctxt *dlm,
res->last_used = jiffies;
list_add_tail(&res->purge, &dlm->purge_list);
/* if this node is not the owner, there is
* no way to keep track of who the owner could be.
* unhash it to avoid serious problems. */
if (res->owner != dlm->node_num) {
mlog(0, "%s:%.*s: doing immediate "
"purge of lockres owned by %u\n",
dlm->name, res->lockname.len,
res->, res->owner);
dlm_purge_lockres_now(dlm, res);
} else if (!list_empty(&res->purge)) {
mlog(0, "removing lockres %.*s from purge list\n",
res->lockname.len, res->;
mlog(0, "removing lockres %.*s from purge list, "
"owner=%u\n", res->lockname.len, res->,
......@@ -180,6 +195,24 @@ finish:
/* make an unused lockres go away immediately.
* as soon as the dlm spinlock is dropped, this lockres
* will not be found. kfree still happens on last put. */
static void dlm_purge_lockres_now(struct dlm_ctxt *dlm,
struct dlm_lock_resource *lockres)
if (!list_empty(&lockres->purge)) {
static void dlm_run_purge_list(struct dlm_ctxt *dlm,
int purge_now)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment