summaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-08-18 11:54:25 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-08-21 09:50:09 -0400
commita345da3e8f28ff69e1b14df78f7ddc6e7b78b726 (patch)
treea1aa40c1aae01064b64b953c9b4a16180dd82be9 /fs/dlm
parent15d00c0b91ca776b51b5ab04f79ab35b06670d30 (diff)
[DLM] dump rsb and locks on assert
Introduce new function dlm_dump_rsb() to call within assertions instead of dlm_print_rsb(). The new function dumps info about all locks on the rsb in addition to rsb details. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/lock.c40
-rw-r--r--fs/dlm/lock.h1
-rw-r--r--fs/dlm/recover.c4
3 files changed, 34 insertions, 11 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index bb2e3515121..712438513cc 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -171,6 +171,28 @@ void dlm_print_rsb(struct dlm_rsb *r)
r->res_recover_locks_count, r->res_name);
}
+void dlm_dump_rsb(struct dlm_rsb *r)
+{
+ struct dlm_lkb *lkb;
+
+ dlm_print_rsb(r);
+
+ printk(KERN_ERR "rsb: root_list empty %d recover_list empty %d\n",
+ list_empty(&r->res_root_list), list_empty(&r->res_recover_list));
+ printk(KERN_ERR "rsb lookup list\n");
+ list_for_each_entry(lkb, &r->res_lookup, lkb_rsb_lookup)
+ dlm_print_lkb(lkb);
+ printk(KERN_ERR "rsb grant queue:\n");
+ list_for_each_entry(lkb, &r->res_grantqueue, lkb_statequeue)
+ dlm_print_lkb(lkb);
+ printk(KERN_ERR "rsb convert queue:\n");
+ list_for_each_entry(lkb, &r->res_convertqueue, lkb_statequeue)
+ dlm_print_lkb(lkb);
+ printk(KERN_ERR "rsb wait queue:\n");
+ list_for_each_entry(lkb, &r->res_waitqueue, lkb_statequeue)
+ dlm_print_lkb(lkb);
+}
+
/* Threads cannot use the lockspace while it's being recovered */
static inline void lock_recovery(struct dlm_ls *ls)
@@ -478,7 +500,7 @@ static void unhold_rsb(struct dlm_rsb *r)
{
int rv;
rv = kref_put(&r->res_ref, toss_rsb);
- DLM_ASSERT(!rv, dlm_print_rsb(r););
+ DLM_ASSERT(!rv, dlm_dump_rsb(r););
}
static void kill_rsb(struct kref *kref)
@@ -488,12 +510,12 @@ static void kill_rsb(struct kref *kref)
/* All work is done after the return from kref_put() so we
can release the write_lock before the remove and free. */
- DLM_ASSERT(list_empty(&r->res_lookup),);
- DLM_ASSERT(list_empty(&r->res_grantqueue),);
- DLM_ASSERT(list_empty(&r->res_convertqueue),);
- DLM_ASSERT(list_empty(&r->res_waitqueue),);
- DLM_ASSERT(list_empty(&r->res_root_list),);
- DLM_ASSERT(list_empty(&r->res_recover_list),);
+ DLM_ASSERT(list_empty(&r->res_lookup), dlm_dump_rsb(r););
+ DLM_ASSERT(list_empty(&r->res_grantqueue), dlm_dump_rsb(r););
+ DLM_ASSERT(list_empty(&r->res_convertqueue), dlm_dump_rsb(r););
+ DLM_ASSERT(list_empty(&r->res_waitqueue), dlm_dump_rsb(r););
+ DLM_ASSERT(list_empty(&r->res_root_list), dlm_dump_rsb(r););
+ DLM_ASSERT(list_empty(&r->res_recover_list), dlm_dump_rsb(r););
}
/* Attaching/detaching lkb's from rsb's is for rsb reference counting.
@@ -1336,7 +1358,7 @@ static void grant_pending_locks(struct dlm_rsb *r)
struct dlm_lkb *lkb, *s;
int high = DLM_LOCK_IV;
- DLM_ASSERT(is_master(r), dlm_print_rsb(r););
+ DLM_ASSERT(is_master(r), dlm_dump_rsb(r););
high = grant_pending_convert(r, high);
high = grant_pending_wait(r, high);
@@ -1431,7 +1453,7 @@ static int set_master(struct dlm_rsb *r, struct dlm_lkb *lkb)
return 0;
}
- DLM_ASSERT(r->res_nodeid == -1, dlm_print_rsb(r););
+ DLM_ASSERT(r->res_nodeid == -1, dlm_dump_rsb(r););
dir_nodeid = dlm_dir_nodeid(r);
diff --git a/fs/dlm/lock.h b/fs/dlm/lock.h
index 8d2660f0ab1..0843a3073ec 100644
--- a/fs/dlm/lock.h
+++ b/fs/dlm/lock.h
@@ -14,6 +14,7 @@
#define __LOCK_DOT_H__
void dlm_print_rsb(struct dlm_rsb *r);
+void dlm_dump_rsb(struct dlm_rsb *r);
void dlm_print_lkb(struct dlm_lkb *lkb);
int dlm_receive_message(struct dlm_header *hd, int nodeid, int recovery);
int dlm_modes_compat(int mode1, int mode2);
diff --git a/fs/dlm/recover.c b/fs/dlm/recover.c
index 1a86dfc8034..528a2a0fa32 100644
--- a/fs/dlm/recover.c
+++ b/fs/dlm/recover.c
@@ -490,7 +490,7 @@ static int recover_locks(struct dlm_rsb *r)
if (all_queues_empty(r))
goto out;
- DLM_ASSERT(!r->res_recover_locks_count, dlm_print_rsb(r););
+ DLM_ASSERT(!r->res_recover_locks_count, dlm_dump_rsb(r););
error = recover_locks_queue(r, &r->res_grantqueue);
if (error)
@@ -557,7 +557,7 @@ int dlm_recover_locks(struct dlm_ls *ls)
void dlm_recovered_lock(struct dlm_rsb *r)
{
- DLM_ASSERT(rsb_flag(r, RSB_NEW_MASTER), dlm_print_rsb(r););
+ DLM_ASSERT(rsb_flag(r, RSB_NEW_MASTER), dlm_dump_rsb(r););
r->res_recover_locks_count--;
if (!r->res_recover_locks_count) {