From c33cd87b28122c8d059b4d05d373ae447348523e Mon Sep 17 00:00:00 2001 From: jxiong Date: Mon, 22 Jun 2009 18:39:46 +0000 Subject: [PATCH 1/1] b=19188 r=pravin,rread More debug info are added to catch bugs. --- lustre/llite/vvp_page.c | 6 +++--- lustre/obdclass/cl_io.c | 5 ++++- lustre/osc/osc_lock.c | 16 ++++++++++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/lustre/llite/vvp_page.c b/lustre/llite/vvp_page.c index 548ffb0..f543f59 100644 --- a/lustre/llite/vvp_page.c +++ b/lustre/llite/vvp_page.c @@ -91,13 +91,13 @@ static void vvp_page_own(const struct lu_env *env, while (TestSetPageLocked(vmpage)) { cfs_schedule_timeout(CFS_TASK_INTERRUPTIBLE, cfs_time_seconds(1)/10); - if (++count > 100) { + if (++count > 600) { CL_PAGE_DEBUG(D_ERROR, env, cl_page_top(slice->cpl_page), "XXX page %p blocked on acquiring the" - " lock. process %s/%p, flags %lx\n", + " lock. process %s/%p, flags %lx,io %p\n", vmpage, current->comm, current, - vmpage->flags); + vmpage->flags, _); libcfs_debug_dumpstack(NULL); LCONSOLE_WARN("Reproduced bug #18881,please contact:" "jay , thanks\n"); diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index e36bc31..1a172f4 100644 --- a/lustre/obdclass/cl_io.c +++ b/lustre/obdclass/cl_io.c @@ -1129,6 +1129,7 @@ int cl_page_list_own(const struct lu_env *env, { struct cl_page *page; struct cl_page *temp; + pgoff_t index = 0; int result; LINVRNT(plist->pl_owner == cfs_current()); @@ -1136,8 +1137,10 @@ int cl_page_list_own(const struct lu_env *env, ENTRY; result = 0; cl_page_list_for_each_safe(page, temp, plist) { + LASSERT(index <= page->cp_index); + index = page->cp_index; if (cl_page_own(env, io, page) == 0) - result = result ?: page->cp_error; + result = result ?: page->cp_error; else cl_page_list_del(env, plist, page); } diff --git a/lustre/osc/osc_lock.c b/lustre/osc/osc_lock.c index c9d8e31..f77c342 100644 --- a/lustre/osc/osc_lock.c +++ b/lustre/osc/osc_lock.c @@ -62,6 +62,7 @@ static const struct cl_lock_operations osc_lock_ops; static const struct cl_lock_operations osc_lock_lockless_ops; static void osc_lock_to_lockless(const struct lu_env *env, struct osc_lock *ols, int force); +static int osc_lock_has_pages(struct osc_lock *olck); int osc_lock_is_lockless(const struct osc_lock *olck) { @@ -1381,8 +1382,10 @@ static int osc_lock_flush(struct osc_lock *ols, int discard) cl_env_nested_put(&nest, env); } else result = PTR_ERR(env); - if (result == 0) + if (result == 0) { ols->ols_flush = 1; + LINVRNT(!osc_lock_has_pages(ols)); + } return result; } @@ -1495,7 +1498,10 @@ static int osc_lock_has_pages(struct osc_lock *olck) return result; } #else -# define osc_lock_has_pages(olck) (0) +static int osc_lock_has_pages(struct osc_lock *olck) +{ + return 0; +} #endif /* INVARIANT_CHECK */ static void osc_lock_delete(const struct lu_env *env, @@ -1504,6 +1510,12 @@ static void osc_lock_delete(const struct lu_env *env, struct osc_lock *olck; olck = cl2osc_lock(slice); + if (olck->ols_glimpse) { + LASSERT(!olck->ols_hold); + LASSERT(!olck->ols_lock); + return; + } + LINVRNT(osc_lock_invariant(olck)); LINVRNT(!osc_lock_has_pages(olck)); -- 1.8.3.1